diff --git a/flake.nix b/flake.nix index 4b5a7d7..939271e 100644 --- a/flake.nix +++ b/flake.nix @@ -30,25 +30,22 @@ ./hosts/${host}/hardware-configuration.nix { nixpkgs.overlays = [ nur.overlay ]; } { - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - security.polkit.enable = true; nixpkgs.config.allowUnfree = true; networking.hostName = host; - boot.loader.systemd-boot = { - enable = true; - memtest86.enable = true; - netbootxyz.enable = true; - }; - boot.loader.timeout = 1; - boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.enable = true; time.timeZone = "Europe/Brussels"; + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + }; nix.settings = { - substituters = [ "https://hyprland.cachix.org" "https://nix-community.cachix.org" "https://cuda-maintainers.cachix.org" "https://nixos-rocm.cachix.org" ]; + substituters = [ + "https://hyprland.cachix.org" + "https://nix-community.cachix.org" + "https://cuda-maintainers.cachix.org" + "https://nixos-rocm.cachix.org" + ]; trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" @@ -56,7 +53,7 @@ "nixos-rocm.cachix.org-1:VEpsf7pRIijjd8csKjFNBGzkBqOmw8H9PRmgAq14LnE=" ]; experimental-features = [ "nix-command" "flakes" ]; - trusted-users = [ "root" "user" ]; + trusted-users = [ "root" user ]; auto-optimise-store = true; }; @@ -66,31 +63,6 @@ options = "--delete-older-than 2d"; }; - programs.zsh.enable = true; - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.hyprland; - }; - - services.greetd = { - enable = true; - settings = rec { - initial_session = { - command = "Hyprland"; - user = "user"; - }; - default_session = initial_session; - }; - }; - - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; users.users.${user} = { isNormalUser = true; @@ -106,31 +78,8 @@ shell = pkgs.zsh; }; - environment.systemPackages = with pkgs; [ wget curl git lm_sensors ]; - - services.openssh = { - enable = true; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - }; - }; - - networking.firewall.enable = false; system.stateVersion = "23.11"; - environment.sessionVariables.NIXOS_OZONE_WL = - "1"; # hint electron apps to use wayland: - - fonts.packages = with pkgs; [ - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - iosevka - nerdfonts - roboto - font-awesome - ]; - + environment.sessionVariables.NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland: } home-manager.nixosModules.home-manager { diff --git a/home/Kell.nix b/home/Kell.nix index ebec31b..3f9f17c 100644 --- a/home/Kell.nix +++ b/home/Kell.nix @@ -12,7 +12,7 @@ ./ssh ./mpv ]; - home.packages = with pkgs; [ telegram-desktop webcord devenv loupe ]; + home.packages = with pkgs; [ telegram-desktop webcord devenv loupe evince ]; programs.ssh.matchBlocks."*".identityFile = "/home/server/.secrets/SSH/Kell/id_ed25519"; services.hyprpaper = { diff --git a/hosts/Aloria/default.nix b/hosts/Aloria/default.nix index 4703c6a..7fc8b55 100644 --- a/hosts/Aloria/default.nix +++ b/hosts/Aloria/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, inputs, config, ... }: let mkConnection = name: cfg: { connection = { @@ -34,24 +34,17 @@ connections = { }; in { - services.pcscd.enable = true; + imports = [ + (import ../Common { inherit inputs pkgs; }) + ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.opengl.extraPackages = [ pkgs.intel-compute-runtime pkgs.intel-media-driver ]; - services.thermald.enable = true; - services.fwupd.enable = true; - services.fstrim.enable = true; environment.systemPackages = with pkgs; [ - wireguard-tools - - # Podman - dive - podman-tui - docker-compose - - # CUDA + # Cuda pciutils file gnumake @@ -89,41 +82,13 @@ in }; }; }; - services.udev.packages = [ pkgs.yubikey-personalization ]; -# Enable common container config files in /etc/containers - virtualisation.containers.enable = true; - virtualisation = { - podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; - }; services.ollama = { enable = true; acceleration = "cuda"; }; - # Calendar - programs.dconf.enable = true; - services.gnome.evolution-data-server.enable = true; - services.gnome.gnome-online-accounts.enable = true; - services.gnome.gnome-keyring.enable = true; - - # Add the server using gnome-online-accounts: - # nix-shell -p gnome.gnome-control-center --run "gnome-control-center" - # Just add the main webdav server and gnome-calendar will automatically pick up all available calendars. - - # networking.nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; - # services.resolved = { - # enable = true; - # dnssec = "true"; - # domains = [ "~." ]; - # fallbackDns = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; - # dnsovertls = "true"; - # }; networking.wg-quick.interfaces = { wg0 = { @@ -161,49 +126,4 @@ in }; }; - services.resolved = { - enable = true; - fallbackDns = [ "1.1.1.1" "1.0.0.1" ]; - }; - - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; - services.blueman.enable = true; - systemd.user.services.mpris-proxy = { - description = "Mpris proxy"; - after = [ "network.target" "sound.target" ]; - wantedBy = [ "default.target" ]; - serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; - }; - hardware.bluetooth.settings = { - General = { - Experimental = true; - }; - }; - - fileSystems."/home/server" = { - device = "10.1:/home/server"; - fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; - }; - fileSystems."/home/user/Workspace" = { - device = "10.1:/home/server/Workspace"; - fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; - }; - fileSystems."/home/user/Documents" = { - device = "10.1:/home/server/Storage/Thomas/Documents"; - fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; - }; - fileSystems."/home/user/Pictures" = { - device = "10.1:/home/server/Storage/Thomas/Pictures"; - fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; - }; - fileSystems."/home/user/Videos" = { - device = "10.1:/home/server/Storage/Thomas/Videos"; - fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; - }; } diff --git a/hosts/Common/default.nix b/hosts/Common/default.nix new file mode 100644 index 0000000..1a6154c --- /dev/null +++ b/hosts/Common/default.nix @@ -0,0 +1,139 @@ +{ pkgs, ... }: +{ + security.polkit.enable = true; + + boot.loader.systemd-boot.memtest86.enable = true; + boot.loader.systemd-boot.netbootxyz.enable = true; + boot.loader.timeout = 1; + boot.loader.efi.canTouchEfiVariables = true; + + services.thermald.enable = true; + services.pcscd.enable = true; + services.fwupd.enable = true; + services.fstrim.enable = true; + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + programs.zsh.enable = true; + + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + + fonts.packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + iosevka + nerdfonts + roboto + font-awesome + ]; + + networking.firewall.enable = false; + + services.greetd = { + enable = true; + settings = rec { + initial_session = { + command = "Hyprland"; + user = "user"; + }; + default_session = initial_session; + }; + }; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + environment.systemPackages = with pkgs; [ + wget + curl + git + lm_sensors + wireguard-tools + + # Podman + dive + podman-tui + docker-compose + ]; + services.udev.packages = [ pkgs.yubikey-personalization ]; + + virtualisation.containers.enable = true; + virtualisation = { + podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + }; + +# Calendar +# Add the server using gnome-online-accounts: +# nix-shell -p gnome.gnome-control-center --run "gnome-control-center" +# Just add the main webdav server and gnome-calendar will automatically pick up all available calendars. + programs.dconf.enable = true; + services.gnome.evolution-data-server.enable = true; + services.gnome.gnome-online-accounts.enable = true; + services.gnome.gnome-keyring.enable = true; + + services.resolved = { + enable = true; + fallbackDns = [ "1.1.1.1" "1.0.0.1" ]; + }; + + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + services.blueman.enable = true; + systemd.user.services.mpris-proxy = { + description = "Mpris proxy"; + after = [ "network.target" "sound.target" ]; + wantedBy = [ "default.target" ]; + serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; + }; + hardware.bluetooth.settings = { + General = { + Experimental = true; + }; + }; + + fileSystems."/home/server" = { + device = "10.1:/home/server"; + fsType = "nfs"; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; + }; + fileSystems."/home/user/Workspace" = { + device = "10.1:/home/server/Workspace"; + fsType = "nfs"; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; + }; + fileSystems."/home/user/Documents" = { + device = "10.1:/home/server/Storage/Thomas/Documents"; + fsType = "nfs"; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; + }; + fileSystems."/home/user/Pictures" = { + device = "10.1:/home/server/Storage/Thomas/Pictures"; + fsType = "nfs"; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; + }; + fileSystems."/home/user/Videos" = { + device = "10.1:/home/server/Storage/Thomas/Videos"; + fsType = "nfs"; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; + }; + +} diff --git a/hosts/Kell/default.nix b/hosts/Kell/default.nix index 5188796..173ddd7 100644 --- a/hosts/Kell/default.nix +++ b/hosts/Kell/default.nix @@ -1,6 +1,10 @@ { inputs, config, pkgs, ... }: { + imports = [ + (import ../Common { inherit inputs pkgs; }) + ]; + # AMD CPU boot.blacklistedKernelModules = [ "k10temp" ]; boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ]; @@ -8,37 +12,7 @@ # AMD CPU & GPU boot.initrd.kernelModules = [ "amdgpu" ]; - services.pcscd.enable = true; - services.udev.packages = [ pkgs.yubikey-personalization ]; services.logind.extraConfig = ''HandlePowerKey=suspend''; - services.fstrim.enable = true; - services.fwupd.enable = true; - - # Calendar - programs.dconf.enable = true; - services.gnome.evolution-data-server.enable = true; - services.gnome.gnome-online-accounts.enable = true; - services.gnome.gnome-keyring.enable = true; - environment.systemPackages = with pkgs; [ - wireguard-tools - - # Podman - dive - podman-tui - docker-compose - ]; - # Add the server using gnome-online-accounts: - # nix-shell -p gnome.gnome-control-center --run "gnome-control-center" - # Just add the main webdav server and gnome-calendar will automatically pick up all available calendars. - - virtualisation.containers.enable = true; - virtualisation = { - podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; - }; services.ollama = { enable = true; @@ -58,29 +32,4 @@ }]; }; }; - fileSystems."/home/server" = { - device = "192.168.1.2:/home/server"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; - }; - fileSystems."/home/user/Workspace" = { - device = "192.168.1.2:/home/server/Workspace"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; - }; - fileSystems."/home/user/Documents" = { - device = "192.168.1.2:/home/server/Storage/Thomas/Documents"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; - }; - fileSystems."/home/user/Pictures" = { - device = "192.168.1.2:/home/server/Storage/Thomas/Pictures"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; - }; - fileSystems."/home/user/Videos" = { - device = "192.168.1.2:/home/server/Storage/Thomas/Videos"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; - }; }