diff --git a/flake.lock b/flake.lock index c1cf6cb..3282aba 100644 --- a/flake.lock +++ b/flake.lock @@ -11,11 +11,11 @@ "yafas": "yafas" }, "locked": { - "lastModified": 1722126515, - "narHash": "sha256-Pz8/0lFWhoHOReOJwbf4Fbx0ANGWc306QnuUeMR9keU=", + "lastModified": 1722269440, + "narHash": "sha256-eUzqnxgHIfxGcXk0SwXwP011uQ41WOEHX+gg1uPSkcE=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "d11e6cfcb6c09dbb9ae0265cfe7a684bcde02ec6", + "rev": "a383380ec33f66ef92c4e815260271f6ad7cf286", "type": "github" }, "original": { @@ -46,11 +46,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1721160462, - "narHash": "sha256-/VxDWswjySr3CUuMRP4OBBP3sFSps7r1Bh/AJkZSdVk=", + "lastModified": 1722449994, + "narHash": "sha256-xcpJE83RMrMPcfmoSScTs8yxGGIexOaHCt2lb3rKzzU=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "b2d62f3b793495c1156cba6a99512cd95ac2c439", + "rev": "7bccbcaafaf1e1e8077c0440c9e2defc8f5a2a75", "type": "github" }, "original": { @@ -251,11 +251,11 @@ ] }, "locked": { - "lastModified": 1722067813, - "narHash": "sha256-nxpzoKXwn+8RsxpxwD86mtEscOMw64ZD/vGSNWzGMlA=", + "lastModified": 1722119539, + "narHash": "sha256-2kU90liMle0vKR8exJx1XM4hZh9CdNgZGHCTbeA9yzY=", "owner": "nix-community", "repo": "home-manager", - "rev": "975b83ca560d17db51a66cb2b0dc0e44213eab27", + "rev": "d0240a064db3987eb4d5204cf2400bc4452d9922", "type": "github" }, "original": { @@ -292,11 +292,11 @@ ] }, "locked": { - "lastModified": 1722119539, - "narHash": "sha256-2kU90liMle0vKR8exJx1XM4hZh9CdNgZGHCTbeA9yzY=", + "lastModified": 1722407237, + "narHash": "sha256-wcpVHUc2nBSSgOM7UJSpcRbyus4duREF31xlzHV5T+A=", "owner": "nix-community", "repo": "home-manager", - "rev": "d0240a064db3987eb4d5204cf2400bc4452d9922", + "rev": "58cef3796271aaeabaed98884d4abaab5d9d162d", "type": "github" }, "original": { @@ -417,11 +417,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1722082646, - "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", + "lastModified": 1722445220, + "narHash": "sha256-PW5FRqLhqg0xGpPjY2Poa464tyBQiyKd0tQGZ0HnMiU=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", + "rev": "7e08a9dd34314fb8051c28b231a68726c54daa7b", "type": "github" }, "original": { @@ -495,11 +495,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1722114937, - "narHash": "sha256-MOZ9woPwdpFJcHx3wic2Mlw9aztdKjMnFT3FaeLzJkM=", + "lastModified": 1722332872, + "narHash": "sha256-2xLM4sc5QBfi0U/AANJAW21Bj4ZX479MHPMPkB+eKBU=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "e67b60fb1b2c3aad2202d95b91d4c218cf2a4fdd", + "rev": "14c333162ba53c02853add87a0000cbd7aa230c2", "type": "github" }, "original": { @@ -527,11 +527,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1720954236, - "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", + "lastModified": 1722221733, + "narHash": "sha256-sga9SrrPb+pQJxG1ttJfMPheZvDOxApFfwXCFO0H9xw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", + "rev": "12bf09802d77264e441f48e25459c10c93eada2e", "type": "github" }, "original": { @@ -559,11 +559,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1722087241, - "narHash": "sha256-2ShmEaFi0kJVOEEu5gmlykN5dwjWYWYUJmlRTvZQRpU=", + "lastModified": 1722221733, + "narHash": "sha256-sga9SrrPb+pQJxG1ttJfMPheZvDOxApFfwXCFO0H9xw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8c50662509100d53229d4be607f1a3a31157fa12", + "rev": "12bf09802d77264e441f48e25459c10c93eada2e", "type": "github" }, "original": { @@ -575,11 +575,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1722062969, - "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", + "lastModified": 1722185531, + "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", + "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", "type": "github" }, "original": { @@ -591,11 +591,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1720957393, - "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "lastModified": 1722185531, + "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", "type": "github" }, "original": { diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 0bebbbc..8691a2e 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -84,6 +84,67 @@ in desktopManager.plasma6.enable = false; }; }; + + hyprland.configuration = { + services = { + displayManager.sddm.enable = true; + displayManager.defaultSession = "hyprland"; + # disable plasma + desktopManager.plasma6.enable = false; + }; + + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + + # Hint Electon apps to use wayland + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; + }; + + environment.systemPackages = with pkgs; [ + hyprland + swww # for wallpapers + xdg-desktop-portal-gtk + xdg-desktop-portal-hyprland + xwayland + meson + wayland-protocols + wayland-utils + wl-clipboard + wlroots + networkmanagerapplet + kitty + rofi-wayland + wofi + dunst + libnotify + waybar + ]; + + services.dbus.enable = true; + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + }; + + fonts.fonts = with pkgs; [ + nerdfonts + meslo-lgs-nf + ]; + + nixpkgs.overlays = [ + (self: super: { + waybar = super.waybar.overrideAttrs (oldAttrs: { + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + }); + }) + ]; + }; }; apps.discover-wrapped.enable = false; @@ -154,27 +215,38 @@ in ratbagd.enable = true; }; - systemd.services = { - fix-wifi = { - path = [ - pkgs.bash - pkgs.networkmanager - pkgs.kmod - ]; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - serviceConfig = { - Type = "oneshot"; - ExecStart = [ "${resetNetworkScript}/bin/reset-network" ]; + systemd = { + services = { + fix-wifi = { + path = [ + pkgs.bash + pkgs.networkmanager + pkgs.kmod + ]; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = [ "${resetNetworkScript}/bin/reset-network" ]; + }; }; }; - # rsync-home = { - # path = [ pkgs.bash pkgs.rsync ]; - # script = '' - # rsync -rtpogv --progress --ignore-existing --exclude={'/home/matt/Games/*', '/home/matt/1TB/*'} -lHzs /home/matt /media/nas/backup/desktop-nix/home - # ''; - # }; + user.services = { + rclone-home-proton = { + path = [ pkgs.bash pkgs.rclone ]; + script = '' + rclone sync /home/matt proton-drive:backup-nix --exclude '/home/matt/Games/**' --exclude '/home/matt/1TB/**' --exclude '/home/matt/Downloads/**' + ''; + }; + + rsync-home = { + path = [ pkgs.bash pkgs.rsync pkgs.openssh ]; + script = '' + rsync -rtpogvPlHzs --ignore-existing --exclude={'/home/matt/Games', '/home/matt/1TB', '/home/matt/Downloads/*', '/home/matt/.cache'} -e ssh /home/matt admin@10.0.1.18:/media/nas/main/backup/desktop-nix/home + ''; + }; + }; }; # Networking configs @@ -218,8 +290,11 @@ in nano onlyoffice-bin os-prober + nil papirus-icon-theme pciutils + rclone + rclone-browser rsync sbctl vim @@ -248,6 +323,7 @@ in "wheel" "networkmanager" "ratbagd" + "input" ]; # Enable ‘sudo’ for the user. shell = pkgs.zsh; }; diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index 95ab43b..944873b 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -1,7 +1,4 @@ { pkgs, ... }: -# let -# gnome = false; -# in { home.username = "matt"; @@ -23,6 +20,7 @@ shellAliases = { ll = "ls -alh"; update = "sudo nixos-rebuild switch"; + update-flake = "sudo nix flake update ~/nix-config"; update-specialisation = "sudo nixos-rebuild switch --specialisation"; nas-update = "nixos-rebuild switch --use-remote-sudo --target-host admin@jallen-nas.local --build-host localhost --flake ~/nix-config#jallen-nas"; nas-ssh = "ssh admin@jallen-nas.local"; @@ -68,6 +66,7 @@ gamescope-wsi_git goverlay heroic + home-manager libreoffice-qt6-fresh lm_sensors lutris @@ -84,6 +83,11 @@ protonvpn-gui protonvpn-gui python3 + python312Packages.tox + python312Packages.setuptools + python312Packages.pytest + python312Packages.pytest-cov + python312Packages.pyaml spotify tree virt-manager @@ -124,4 +128,32 @@ }; }; + specialisation.hyprland.configuration = { + wayland.windowManager.hyprland.enable = true; + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + bind = + [ + "$mod, F, exec, firefox" + ", Print, exec, grimblast copy area" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) + 10) + ); + }; + }; + } diff --git a/hosts/nas/configuration.nix b/hosts/nas/configuration.nix index 309c84a..88fd1b2 100755 --- a/hosts/nas/configuration.nix +++ b/hosts/nas/configuration.nix @@ -97,6 +97,7 @@ in nodejs-18_x nut nmon + pass protonvpn-cli protonmail-bridge pass @@ -147,6 +148,7 @@ in # Admin account users."${user}" = { isNormalUser = true; + linger = true; extraGroups = [ "wheel" "networkmanager" diff --git a/hosts/nas/hardware-configuration.nix b/hosts/nas/hardware-configuration.nix index 7300c4b..4268f13 100644 --- a/hosts/nas/hardware-configuration.nix +++ b/hosts/nas/hardware-configuration.nix @@ -88,7 +88,16 @@ ]; }; - swapDevices = [ { device = "/dev/disk/by-uuid/c08ba901-a8a9-4006-9688-002bb24da1b6"; } ]; + swapDevices = [ + { + device = "/dev/disk/by-id/ata-Samsung_SSD_860_EVO_500GB_S3Z1NW0KA10457X-part2"; + randomEncryption.enable = true; + } + { + device = "/dev/disk/by-id/ata-SSD2SC240G1SA754D117-820_PNY29140000558890457"; + randomEncryption.enable = true; + } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/nas/services.nix b/hosts/nas/services.nix index 1b69b5a..1df9837 100644 --- a/hosts/nas/services.nix +++ b/hosts/nas/services.nix @@ -155,9 +155,28 @@ in }; }; + systemd.user.services = { + protonmail-bridge = { + description = "Protonmail Bridge"; + enable = true; + script = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive"; + path = [ pkgs.pass pkgs.protonmail-bridge ]; + wantedBy = [ "multi-user.target" ]; + partOf = [ "multi-user.target" ]; + }; + }; + systemd.services = { + rsync-ssd = { + path = [ pkgs.bash pkgs.rsync ]; + script = '' + rsync -rtpogvPlHzs --ignore-existing /media/nas/ssd /media/nas/main/backup/ssd + ''; + }; + tailscale-autoconnect = { + enable = false; description = "Automatic connection to Tailscale"; # make sure tailscale is running before trying to connect to tailscale