diff --git a/home/default.nix b/home/default.nix index a0624855..88997e53 100644 --- a/home/default.nix +++ b/home/default.nix @@ -10,6 +10,7 @@ ./git.nix ./gpg.nix ./helix.nix + ./hyprland ./packages.nix ./playerctld.nix ./rofi.nix diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 689ab946..145de5a8 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -1,10 +1,12 @@ -{...}: { +{ system-config, lib, ...}: { imports = [ - ./hyprgrass.nix - ./utils.nix +# ./hyprgrass.nix +# ./utils.nix ]; - wayland.windowManager.hyprland = { + wayland.windowManager = let + + hyprDefaults = { enable = true; xwayland.enable = true; @@ -16,8 +18,7 @@ "$fileManager" = "alacritty -e ranger"; monitor = [ - "eDP-1, 1920x1080, 0x0, 1" - ",preferred,auto,1" + ",preferred,1" ]; exec-once = [ @@ -55,8 +56,8 @@ gaps_in = 5; gaps_out = 5; border_size = 2; - "col.active_border" = "rgba(5bcefaee) rgba(f5a9b8ee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; +# "col.active_border" = "rgba(5bcefaee) rgba(f5a9b8ee) 45deg"; +# "col.inactive_border" = "rgba(595959aa)"; layout = "dwindle"; @@ -75,7 +76,7 @@ drop_shadow = true; shadow_range = 4; shadow_render_power = 3; - "col.shadow" = "rgba(1a1a1aee)"; +# "col.shadow" = "rgba(1a1a1aee)"; }; animations = { @@ -170,4 +171,7 @@ ]; }; }; + in { + hyprland = lib.recursiveUpdate hyprDefaults system-config.hyprlandOverrides; + }; } diff --git a/home/persist.nix b/home/persist.nix index 6988d6d4..f3b18dfa 100644 --- a/home/persist.nix +++ b/home/persist.nix @@ -1,16 +1,15 @@ -{ - lib, - config, - ... -}: { +{lib, config}: { data = { directories = [ ".config/syncthing" + ".config/sops" ".gnupg" ".local/share/PrismLauncher/instances" ".ssh" "nixos" + "sync" + "code" ]; files = []; }; @@ -22,18 +21,13 @@ ".cargo" ".config/obsidian" ".config/spotify" - ( - lib.optional - config.gaming.enable - ".local/share/PrismLauncher" - ) - ( - lib.optional - config.gaming.enable - ".local/share/Steam" - ) ".local/state/wireplumber" ".thunderbird" + "tmp" + ] ++ lib.optionals config.gaming.enable [ + ".local/share/PrismLauncher" + ".local/share/Steam" + ".steam" ]; files = []; }; diff --git a/home/sops.nix b/home/sops.nix index a0683c4d..098a31d4 100644 --- a/home/sops.nix +++ b/home/sops.nix @@ -5,6 +5,6 @@ }: { imports = [sops-nix.homeManagerModules.sops]; sops = { - age.keyFile = "/persist/data${conf.home}/.config/sops/age/keys.txt"; + age.keyFile = /persist/data${conf.home}/.config/sops/age/keys.txt; }; } diff --git a/hosts/lilith-pc/default.nix b/hosts/lilith-pc/default.nix index e138dcfa..1ccdb0e7 100644 --- a/hosts/lilith-pc/default.nix +++ b/hosts/lilith-pc/default.nix @@ -3,5 +3,20 @@ extraConfig = { config.gaming.enable = true; + + config.hyprlandOverrides = { + settings = { + input = { + kb_layout = "us,ru"; + kb_options = "gpr:win_space_toggle"; + }; + + monitor = [ + "DP-3, 3840x2160, 0x0, 1.5" + "DP-4, 2560x1440, 2560x0, 1" + ",preferred,auto,1" + ]; + }; + }; }; } diff --git a/hosts/lilith-pc/hardware-configuration.nix b/hosts/lilith-pc/hardware-configuration.nix index b0225f1a..cb151310 100644 --- a/hosts/lilith-pc/hardware-configuration.nix +++ b/hosts/lilith-pc/hardware-configuration.nix @@ -1,33 +1,59 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + { - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = []; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/080fa116-424e-4079-a2a6-658a230e2721"; - fsType = "ext4"; - }; + fileSystems."/" = + { device = "tmpfs"; + fsType = "tmpfs"; + options = [ "defaults" ]; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/40E8-A12D"; - fsType = "vfat"; - }; + fileSystems."/persist/data" = + { device = "/dev/disk/by-uuid/5dbe939d-54a5-4092-b9c6-83f6bd4cf925"; + fsType = "btrfs"; + neededForBoot = true; + options = [ "noatime" "compress=zstd" "subvol=persist/@data" ]; + }; - swapDevices = []; + fileSystems."/persist/cache" = + { device = "/dev/disk/by-uuid/5dbe939d-54a5-4092-b9c6-83f6bd4cf925"; + fsType = "btrfs"; + neededForBoot = true; + options = [ "noatime" "compress=zstd" "subvol=persist/@cache" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/5dbe939d-54a5-4092-b9c6-83f6bd4cf925"; + fsType = "btrfs"; + neededForBoot = true; + options = [ "noatime" "compress=zstd" "subvol=nix" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/6437-97E8"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # 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 + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/lilith-pc/secrets/default.yaml b/hosts/lilith-pc/secrets/default.yaml index 999df02c..fc890eac 100644 --- a/hosts/lilith-pc/secrets/default.yaml +++ b/hosts/lilith-pc/secrets/default.yaml @@ -3,6 +3,9 @@ user: ssh: public: ENC[AES256_GCM,data:DYYGLTFvmZa/bvAo0dvHiL9jt6cfSeZZN5Omo3af1lHhOfQYapqm7DXOf6xBn0HNr32L4gFEpE+2IquUaPUtY48nsC+PiuFSp1x/73/sjOCZdcTkGh7ehwZ4PECN3goIBw==,iv:Q4YZSMQhuIuiuiN94aHk2pwForVESEHhXjDAGTAhvR0=,tag:dFFBjKqIwn75m8GaXosjMQ==,type:str] private: ENC[AES256_GCM,data:DHRNPGp2BRPuZ5mATxIsuKsKIjVo+hrzX+L+yZUWc/7xjjpMnlloZ7LCqlP4vXzJAEcolqwpnOLNM796WHtxO5I4HiK9R7p6EDfOGYor62RnhQ4YT7Rc75hWX0vX3dAsvd8/sAYcZMCxVAtCoc4c+UGHdNnh+0Nl6uWO5teakOGPnMqk+Wz1GI//quKxUWs9oRLrZ+093XqTjigcVJ8NcnYDl5RE46HLcgJOp8ii9PeSOI2XM2L6wSWpAO0E3OlAm3z0hTWUcvfIwKzWpkA132JCZJrQtNNsqez0ZBFJQkaaImRDi9y/jT6YInuDhc8gVct04oOda3qKxrm+JWXGOt7HkK54NQFouZbN6e3JZIQaMzz5jPhT/muPs6EsSudorcved/eoyR+rU2Yxn087EVRzqZUZXj3rZpCKWV9rZq8jzOd+g8P7pK1LyUqc98UqSigMdxYwcB6fp/iX7ZcG7wmoRNXbaXXhN1ksY36NqUSNtv5xrF95/THgxwFB6QgY6l+L/7bKblkeLGp1T4MeNSLjHku/0wKCF9fmBiGXTB3evyWlXA42WDJG1SZMS5vT89WV1FiIfsbW6WgYdtMrASxlsDE3qS5TSrUGfjA6+vY=,iv:B6PahG+KL0tuDVS+tF6qOvRJKqyDbKbH/4Qm9Ig7vw4=,tag:Xo0yBa0/fyc3zUzrf3w1LA==,type:str] +syncthing: + cert.pem: ENC[AES256_GCM,data:2a+d67lXxj3Vo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M4pQ4cz7xGzsjZ7b8FjbhIU=,tag:UMx6Q6Vy8yaTPk2IOrPuUA==,type:str] + key.pem: ENC[AES256_GCM,data:66pGKtg2NZajHYKfUsm9fgItbeBeXf6pfsuBOhFkwhFM1AMATwRu1WEHQjD754Z5CC04vQhLONgwbTze6R+1mJJ3wEHjgrTA7v+agSgFfyQLZMV8YRH8eIbG4BLcr9afO84ahqZcWAH/ldFhZeC90nepHK2Lz0+zVIvKsGOPM45OU6Yypjr8FVTVinRr0yJpBgOciJTsZtFqnU2TFJxRoZuOTnTCrO2Kywg+rk1c7augAi30iljZx6Nfi24pBCrcwMeSkiT6uyAhkgiJH6XiIT3V7S/++krsijiTKqV2gqj6zgnE2aUQpinxTSMSj3V9+Hs9AMHdubjV+wb0Tm78m2Hev5iJ0f2gpVufadFCAjcy1ZPttfjBoZ26lOlKF16V,iv:0ewtb+t8woztUvr7XPE0gr94X97hnOaT0LomsmA3dQ0=,tag:0OBaQNkfrd3WQI9JBq15Ug==,type:str] sops: kms: [] gcp_kms: [] @@ -18,8 +21,8 @@ sops: cFV0ZkliUHpKdEsyU0dEQUdNZ0kzb0UKSHUzMLKwB0s2CimzsIbktvng7dDReOzT ygaLq22ZrYvb1etPyroaJA1M5hzNo2VnCMVqa7vUbu/5ZHVLxW9n6Q== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-06-07T22:26:31Z" - mac: ENC[AES256_GCM,data:dP0wFj2hx/YowxQ6+4/YvMsVbGakSlt66iKsZelEwDJVW2u6xjVyscQqaXLrmbq4fBopeumD7IfzHNKlt5dJgr13BYsoinllhPSTAOeJjdyi7okBEzF2Y13yryFZb/Pj6pKaUf4lXIhIxKD7azigJONO7NO38okFYdeCCNrEyfo=,iv:EVxMKMDSMiXpY8RbrzzIbCBpVywEBkwJBxEFBBcAr+A=,tag:5DSyNfDyVr/Dg+P/SG/QzQ==,type:str] + lastmodified: "2024-06-08T18:44:51Z" + mac: ENC[AES256_GCM,data:vDBK+lb0A9y8cgcHYpqA5DBxFlwS0hVk9NQgzKKqeRp+oSIRR0AlaLOJZbxEfZT4YXrQzMAIkIGTOs6Oz0Hn4aG04F+LPT/4N/d0lGacscQtuhpn+CdYpXpaCJ2YjbK+EoXCpparhmxSo15BOnHAGYiP2VEL/MmwvU7QS6+Ke4c=,iv:TzPiDgZsW91aK3gexVDz/xP3OTGlCSCgZ6VKvJB1TZc=,tag:f8TIqs8Z7PuaF5NtzjP3gA==,type:str] pgp: - created_at: "2024-06-07T11:56:01Z" enc: |- diff --git a/system/common.nix b/system/common.nix index 713d914d..a0b4a70f 100644 --- a/system/common.nix +++ b/system/common.nix @@ -11,6 +11,7 @@ file htop btop + git jq yq du-dust diff --git a/system/default.nix b/system/default.nix index b6b3df2c..01658b66 100644 --- a/system/default.nix +++ b/system/default.nix @@ -49,6 +49,7 @@ in { ./ssh.nix ./steam.nix ./stylix.nix + ./syncthing.nix ./wayland.nix ./zsh.nix diff --git a/system/env.nix b/system/env.nix index db7d0053..80fbcb8d 100644 --- a/system/env.nix +++ b/system/env.nix @@ -1,6 +1,7 @@ -{...}: { +{conf, ...}: { environment.variables = { EDITOR = "hx"; VISUAL = "hx"; + FLAKE = "/persist/data" + conf.home + "/nixos"; }; } diff --git a/system/options.nix b/system/options.nix index 4de91a99..88ce587b 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1,4 +1,11 @@ {lib, ...}: { options.gaming.enable = lib.mkEnableOption "Enable gaming"; config.gaming.enable = lib.mkDefault false; + + options.hyprlandOverrides = lib.mkOption { + # type = lib.types.attributeSet; + default = {}; + example = lib.literalExpression ''{ }''; + description = lib.mdDoc ''Override default Hyprland options in hm''; + }; } diff --git a/system/persistence.nix b/system/persistence.nix index 4572a59c..dd5d3290 100644 --- a/system/persistence.nix +++ b/system/persistence.nix @@ -1,4 +1,4 @@ -{impermanence, ...}: { +{impermanence, conf, lib, config, ...}: { imports = [impermanence.nixosModule]; environment.persistence."/persist/data" = { @@ -10,7 +10,7 @@ ]; files = []; - # users.${conf.user} = (import ../home/persist.nix).data; + users.${conf.user} = (import ../home/persist.nix { inherit config lib; }).data; }; environment.persistence."/persist/cache" = { @@ -27,6 +27,6 @@ "/etc/machine-id" ]; - # users.${conf.user} = (import ../home/persist.nix).cache; + users.${conf.user} = (import ../home/persist.nix { inherit config lib; }).cache; }; } diff --git a/system/sops.nix b/system/sops.nix index 6924ad6c..89441731 100644 --- a/system/sops.nix +++ b/system/sops.nix @@ -1,3 +1,6 @@ -{sops-nix, ...}: { +{sops-nix, conf, ...}: { imports = [sops-nix.nixosModules.sops]; + sops = { + age.keyFile = /persist/data${conf.home}/.config/sops/age/keys.txt; + }; } diff --git a/system/syncthing.nix b/system/syncthing.nix new file mode 100644 index 00000000..1155b8e9 --- /dev/null +++ b/system/syncthing.nix @@ -0,0 +1,45 @@ +{ conf, config, ...}: { + + sops.secrets."syncthing/key.pem" = { + sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml + }; + sops.secrets."syncthing/cert.pem" = { + sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml + }; + + services.syncthing = { + user = conf.user; + dataDir = "$(conf.home)/sync"; + configDir = "$(conf.home)/.config/syncthing"; + + overrideDevices = true; + overrideFolders = true; + + settings = { + key = config.sops.secrets."syncthing/key.pem".path; + cert = config.sops.secrets."syncthing/cert.pem".path; + + devices = { + "phone" = {id = "C2CKYRP-72UNJRX-MUPZIUY-CCHQYGF-6T4NA6B-MO7AEZB-RSN5EAG-CN2JCAF";}; + "nixserver" = {id = "DW6GTZ3-3JPAHLO-UEB3LBL-AWOX3BT-QPI7ODT-OZ6Q4YR-K3KK22C-5RY3XQZ";}; + "lilith-pc" = {id = "ZXFUFLA-MJJCNE4-SJTGTYD-SEJZUCX-3KIFTL6-LFIWBBU-HD2LX2F-7FQ5VAF";}; + "lilith-pad" = {id = "GQJA6WA-G5YZZSN-4OOQMVE-JPIR22N-VFHPY4O-XMRG37D-DALH4R2-7DCTMQK";}; + "lilith-old" = {id = "MSUZJ6K-4CIFE5D-ILO6FE4-SPRPTZI-VEWZQ7F-ECARCCF-2VLVMDQ-2HQUAAS";}; + }; + folders = { + "rdcj2-mfyb4" = { + path = "/home/spectre/sync"; + devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"]; + }; + "sdpfs-2beqd" = { + path = "/home/spectre/.keepass"; + devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"]; + }; + "7qim7-yzqpn" = { + path = "/home/spectre/obsidian"; + devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"]; + }; + }; + }; + }; +} diff --git a/system/wayland.nix b/system/wayland.nix index 94400b24..96f2c47d 100644 --- a/system/wayland.nix +++ b/system/wayland.nix @@ -35,7 +35,7 @@ default_session = initial_session; initial_session = { user = conf.user; - command = "Hyprland; hyprlock"; + command = "Hyprland"; }; }; }; diff --git a/system/zsh.nix b/system/zsh.nix index 6440627e..ad14ac47 100644 --- a/system/zsh.nix +++ b/system/zsh.nix @@ -1,4 +1,4 @@ {pkgs, ...}: { - # programs.zsh.enable = true; - # users.defaultUserShell = pkgs.zsh; + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; }