Migrate config (frues-pc machine for now) from https://git.peprolinbot.com/peprolinbot/nixos-config, with improvements
This commit is contained in:
parent
ebd178b0a5
commit
7606f9e051
66 changed files with 9465 additions and 73 deletions
12
modules/desktop/base/default.nix
Normal file
12
modules/desktop/base/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./networking.nix
|
||||
./nix.nix
|
||||
./pipewire.nix
|
||||
./programs.nix
|
||||
./security.nix
|
||||
./services.nix
|
||||
./stylix.nix
|
||||
];
|
||||
}
|
7
modules/desktop/base/hardware.nix
Normal file
7
modules/desktop/base/hardware.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
hardware.flipperzero.enable = true; # Installs and setups everything Flipper Zero
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
hardware.sane.enable = true;
|
||||
}
|
21
modules/desktop/base/networking.nix
Normal file
21
modules/desktop/base/networking.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{pkgs, ...}: {
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
nameservers = ["1.1.1.1"];
|
||||
firewall = {
|
||||
enable = true;
|
||||
|
||||
### https://nixos.wiki/wiki/WireGuard#Setting_up_WireGuard_with_NetworkManager
|
||||
checkReversePath = "loose";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
networkmanagerapplet
|
||||
|
||||
wireguard-tools
|
||||
|
||||
openconnect
|
||||
networkmanager-openconnect
|
||||
];
|
||||
}
|
11
modules/desktop/base/nix.nix
Normal file
11
modules/desktop/base/nix.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{lib, ...}: {
|
||||
nix.settings = {
|
||||
trusted-users = ["pedro"];
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"steam"
|
||||
"steam-unwrapped"
|
||||
];
|
||||
}
|
12
modules/desktop/base/pipewire.nix
Normal file
12
modules/desktop/base/pipewire.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# lowLatency.enable = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
pulseaudioFull
|
||||
];
|
||||
}
|
6
modules/desktop/base/programs.nix
Normal file
6
modules/desktop/base/programs.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{...}: {
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
programs.adb.enable = true;
|
||||
programs.kdeconnect.enable = true;
|
||||
}
|
10
modules/desktop/base/security.nix
Normal file
10
modules/desktop/base/security.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{pkgs, ...}: {
|
||||
security.rtkit.enable = true;
|
||||
security.polkit.enable = true;
|
||||
security.sudo = {
|
||||
enable = true;
|
||||
package = pkgs.sudo.override {withInsults = true;}; # I'm spanish and I love cursing
|
||||
};
|
||||
|
||||
security.pam.services.hyprlock = {};
|
||||
}
|
20
modules/desktop/base/services.nix
Normal file
20
modules/desktop/base/services.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{pkgs, ...}: {
|
||||
services = {
|
||||
gvfs.enable = true;
|
||||
gnome.gnome-keyring.enable = true;
|
||||
dbus.enable = true;
|
||||
|
||||
flatpak.enable = true;
|
||||
|
||||
printing.enable = true;
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
blueman.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [pkgs.libsecret];
|
||||
}
|
16
modules/desktop/base/stylix.nix
Normal file
16
modules/desktop/base/stylix.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.stylix.nixosModules.stylix];
|
||||
stylix = {
|
||||
enable = true;
|
||||
homeManagerIntegration.autoImport = false; # Handled in each user's HM config
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
|
||||
targets = {
|
||||
console.enable = false;
|
||||
grub.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
11
modules/desktop/gaming.nix
Normal file
11
modules/desktop/gaming.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{...}: {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = false;
|
||||
};
|
||||
|
||||
programs.gamemode.enable = true;
|
||||
|
||||
services.joycond.enable = true;
|
||||
}
|
44
modules/desktop/hyprland.nix
Normal file
44
modules/desktop/hyprland.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [./regreet.nix];
|
||||
|
||||
options = {
|
||||
programs.hyprland.autoLogin.username = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
example = "john";
|
||||
description = "User for Hyprland auto login with ReGreet. Disabled by default";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-hyprland
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
|
||||
services.greetd.settings.initial_session = let
|
||||
username = config.programs.hyprland.autoLogin.username;
|
||||
in
|
||||
lib.mkIf (!isNull username) {
|
||||
command = "uwsm start hyprland-uwsm.desktop";
|
||||
user = username;
|
||||
};
|
||||
|
||||
environment.sessionVariables.XKB_DEFAULT_LAYOUT = "es";
|
||||
};
|
||||
}
|
12
modules/desktop/regreet.nix
Normal file
12
modules/desktop/regreet.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
programs.regreet = {
|
||||
enable = true;
|
||||
settings = {
|
||||
background = {
|
||||
path = pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath;
|
||||
fit = "Cover";
|
||||
};
|
||||
};
|
||||
cageArgs = ["-s" "-m" "last"]; # Only show on the last monitor
|
||||
};
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
{ ... }:
|
||||
{
|
||||
# Can be imported into machines to enable GNOME and GDM.
|
||||
#
|
||||
# Copy this into a machine's configuration:
|
||||
# `machines/<name>/configuration.nix`
|
||||
# ```nix
|
||||
# imports = [
|
||||
# ../../modules/gnome.nix
|
||||
# ];
|
||||
# ```
|
||||
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
}
|
13
modules/podman.nix
Normal file
13
modules/podman.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
podman-compose
|
||||
];
|
||||
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
# Create a `docker` alias for podman, to use it as a drop-in replacement
|
||||
dockerCompat = true;
|
||||
# Required for containers under podman-compose to be able to talk to each other.
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
}
|
28
modules/virtualisation.nix
Normal file
28
modules/virtualisation.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{pkgs, ...}: {
|
||||
# Install necessary packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
virt-manager
|
||||
virt-viewer
|
||||
spice
|
||||
spice-gtk
|
||||
spice-protocol
|
||||
win-virtio
|
||||
win-spice
|
||||
adwaita-icon-theme
|
||||
];
|
||||
|
||||
# Manage the virtualisation services
|
||||
virtualisation = {
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
swtpm.enable = true;
|
||||
ovmf.enable = true;
|
||||
ovmf.packages = [pkgs.OVMFFull.fd];
|
||||
};
|
||||
};
|
||||
|
||||
spiceUSBRedirection.enable = true;
|
||||
};
|
||||
services.spice-vdagentd.enable = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue