diff options
author | tzlil <tzlils@protonmail.com> | 2023-02-05 22:29:24 +0200 |
---|---|---|
committer | tzlil <tzlils@protonmail.com> | 2023-02-05 22:29:24 +0200 |
commit | b0422f1bc1ffdfc32f621c26ff8091d6817e4e67 (patch) | |
tree | bd1e2c66651407796a1f104b63fbb2fb0717906c | |
parent | c2efa603990a9a01501b6df1aa38bb8c5d3d01f7 (diff) |
remove password age, add disko config, add vps, trying to get hyprland working
-rw-r--r-- | flake.lock | 167 | ||||
-rw-r--r-- | flake.nix | 7 | ||||
-rw-r--r-- | hosts/disko.nix | 10 | ||||
-rw-r--r-- | hosts/vm/cfg.nix | 8 | ||||
-rw-r--r-- | hosts/vps/cfg.nix | 39 | ||||
-rw-r--r-- | mixins/greet.nix | 37 | ||||
-rw-r--r-- | mixins/hyperland.nix | 14 | ||||
-rw-r--r-- | mixins/hyprland.nix | 8 | ||||
-rw-r--r-- | profiles/network.nix | 1 | ||||
-rw-r--r-- | profiles/user.nix | 2 | ||||
-rw-r--r-- | secrets/id_ed25519.age | bin | 885 -> 1001 bytes | |||
-rw-r--r-- | secrets/secrets.nix | 6 |
12 files changed, 211 insertions, 88 deletions
diff --git a/flake.lock b/flake.lock index 63c4d5d..9822f46 100644 --- a/flake.lock +++ b/flake.lock @@ -2,14 +2,15 @@ "nodes": { "agenix": { "inputs": { + "darwin": "darwin", "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1673301561, - "narHash": "sha256-gRUWHbBAtMuPDJQXotoI8u6+3DGBIUZHkyQWpIv7WpM=", + "lastModified": 1675176355, + "narHash": "sha256-Qjxh5cmN56siY97mzmBLI1+cdjXSPqmfPVsKxBvHmwI=", "owner": "ryantm", "repo": "agenix", - "rev": "42d371d861a227149dc9a7e03350c9ab8b8ddd68", + "rev": "b7ffcfe77f817d9ee992640ba1f270718d197f28", "type": "github" }, "original": { @@ -18,6 +19,28 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673295039, + "narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "87b9d090ad39b25b2400029c64825fc2a8868943", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -26,11 +49,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1674250603, - "narHash": "sha256-SBolFspxBHpW3hCCDNAFXUiO2mucmkVmf17UmSIK3Cs=", + "lastModified": 1675595366, + "narHash": "sha256-WoQkwaaoZqrhWpIrMxA+2j8CgxgyvjHzCyEZAQu06rQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "275ab728912006eecb549338a50f24f294a7cfb7", + "rev": "9621e9ab80a038cd11c7cfcae4df46a59d62b16a", "type": "github" }, "original": { @@ -39,13 +62,55 @@ "type": "github" } }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs_2", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1675606643, + "narHash": "sha256-kzM9G1rkP5rZCuEm4JqXmDOndBvilCA4yQJvZFqSq0w=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "53945cff3184cfdff3ed978e072b4ed65e3b2ec5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671839510, + "narHash": "sha256-+PY1qqJfmZzzROgcIY4I7AkCwpnC+qBIYk2eFoA9RWc=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "b8f55e02a328c47ed373133c52483bbfa20a1b75", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, "impermanence": { "locked": { - "lastModified": 1668668915, - "narHash": "sha256-QjY4ZZbs9shwO4LaLpvlU2bO9J1juYhO9NtV3nrbnYQ=", + "lastModified": 1675359654, + "narHash": "sha256-FPxzuvJkcO49g4zkWLSeuZkln54bLoTtrggZDJBH90I=", "owner": "nix-community", "repo": "impermanence", - "rev": "5df9108b346f8a42021bf99e50de89c9caa251c3", + "rev": "6138eb8e737bffabd4c8fc78ae015d4fd6a7e2fd", "type": "github" }, "original": { @@ -56,7 +121,7 @@ }, "nixinate": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1671116920, @@ -74,11 +139,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1673803274, - "narHash": "sha256-zaJDlHFXewT4KUsidMpRcPE+REymGH1Y3Eoc3Pjv4Xs=", + "lastModified": 1674550793, + "narHash": "sha256-ljJlIFQZwtBbzWqWTmmw2O5BFmQf1A/DspwMOQtGXHk=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "7bd6b87b3712e68007823e8dd5c37ee9b114fee3", + "rev": "b7ac0a56029e4f9e6743b9993037a5aaafd57103", "type": "github" }, "original": { @@ -89,11 +154,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1665732960, - "narHash": "sha256-WBZ+uSHKFyjvd0w4inbm0cNExYTn8lpYFcHEes8tmec=", + "lastModified": 1674641431, + "narHash": "sha256-qfo19qVZBP4qn5M5gXc/h1MDgAtPA5VxJm9s8RUAkVk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4428e23312933a196724da2df7ab78eb5e67a88e", + "rev": "9b97ad7b4330aacda9b2343396eb3df8a853b4fc", "type": "github" }, "original": { @@ -105,6 +170,22 @@ }, "nixpkgs_2": { "locked": { + "lastModified": 1675273418, + "narHash": "sha256-tpYc4TEGvDzh9uRf44QemyQ4TpVuUbxb07b2P99XDbM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4d7c2644dbac9cf8282c0afe68fca8f0f3e7b2db", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { "lastModified": 1653060744, "narHash": "sha256-kfRusllRumpt33J1hPV+CeCCylCXEU7e0gn2/cIM7cY=", "owner": "nixos", @@ -119,13 +200,13 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { - "lastModified": 1674120619, - "narHash": "sha256-xLT1FQl7/jNPOEq5q/vmc3AExt1V9LtcjM+QY2+MUpA=", + "lastModified": 1675545634, + "narHash": "sha256-TbQeQcM5TA/wIho6xtzG+inUfiGzUXi8ewwttiQWYJE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d7705c01ef0a39c8ef532d1033bace8845a07d35", + "rev": "0591d6b57bfeb55dfeec99a671843337bc2c3323", "type": "github" }, "original": { @@ -139,10 +220,11 @@ "inputs": { "agenix": "agenix", "home-manager": "home-manager", + "hyprland": "hyprland", "impermanence": "impermanence", "nixinate": "nixinate", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" } }, "utils": { @@ -159,6 +241,49 @@ "repo": "flake-utils", "type": "github" } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1675374853, + "narHash": "sha256-BSrjNcddYWhFUMtjGwxiEXw67MYRaIHGvLn19Mvm1NE=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "677a3f2f8847ed2de49dd60868f9d9487a546f58", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673116118, + "narHash": "sha256-eR0yDSkR2XYMesfdRWJs25kAdXET2mbNNHu5t+KUcKA=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "d479c846531fd0e1d2357c9588b8310a2b859ef2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index c99f1a3..8af44de 100644 --- a/flake.nix +++ b/flake.nix @@ -11,10 +11,7 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - disko = { - url = github:nix-community/disko; - inputs.nixpkgs.follows = "nixpkgs"; - }; + hyprland.url = "github:hyprwm/Hyprland"; }; outputs = inputs@{ self, ... }: let @@ -25,7 +22,7 @@ specialArgs = {inherit inputs;}; }; mkSystem = pkgs: system: h: (mkSystem_ pkgs system h [ - inputs.agenix.nixosModule inputs.impermanence.nixosModules.impermanence inputs.disko.nixosModules.disko + inputs.agenix.nixosModules.age inputs.impermanence.nixosModules.impermanence ]); in { apps = inputs.nixinate.nixinate.x86_64-linux self; diff --git a/hosts/disko.nix b/hosts/disko.nix index 0a0710e..4808edd 100644 --- a/hosts/disko.nix +++ b/hosts/disko.nix @@ -28,13 +28,13 @@ type = "btrfs"; extraArgs = "-f"; # Override existing partition subvolumes = { - "/nix" = { - mountOptions = ["noatime" "compress=zstd"] - } + "/" = { + mountOptions = ["noatime" "compress=zstd"]; + }; }; }; } - ] + ]; }; }); @@ -42,7 +42,7 @@ "/" = { fsType = "tmpfs"; mountOptions = [ - "size=200M" + "noexec" "defaults" "size=2G" "mode=755" ]; }; }; diff --git a/hosts/vm/cfg.nix b/hosts/vm/cfg.nix index d6f33d9..4042ea0 100644 --- a/hosts/vm/cfg.nix +++ b/hosts/vm/cfg.nix @@ -6,14 +6,14 @@ # ../../profiles/graphical.nix ../../mixins/tailscale.nix ../../mixins/cli.nix - # ../../mixins/greet.nix + ../../mixins/greet.nix + ../../mixins/hyprland.nix # ../../mixins/sway.nix - (modulesPath + "/profiles/qemu-guest.nix") ]; config = { _module.args.nixinate = { - host = "100.109.155.123"; + host = "vm"; sshUser = "tzlil"; buildOn = "remote"; # valid args are "local" or "remote" substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" @@ -71,5 +71,7 @@ enable = true; algorithm = "zstd"; }; + + greeter.initialSession = "sh -c hyprland"; }; } \ No newline at end of file diff --git a/hosts/vps/cfg.nix b/hosts/vps/cfg.nix index f32afea..25da42b 100644 --- a/hosts/vps/cfg.nix +++ b/hosts/vps/cfg.nix @@ -5,30 +5,22 @@ ../../profiles/ssh.nix ../../mixins/tailscale.nix ../../mixins/cli.nix - (modulesPath + "/profiles/qemu-guest.nix") ]; config = { _module.args.nixinate = { - host = "95.179.249.76"; + host = "100.67.217.90"; sshUser = "nixos"; buildOn = "remote"; # valid args are "local" or "remote" substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" hermetic = false; }; - disko.devices = import ../disko.nix { - lib = pkgs.lib; - }; networking.hostName = "vps"; boot = { - initrd = { - supportedFilesystems = ["btrfs"]; - }; kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; kernelParams = [ - "console=ttyS0" "init_on_free=1" "page_poison=1" "page_alloc.shuffle=1" @@ -36,17 +28,21 @@ "vsyscall=none" ]; cleanTmpDir = true; - loader = { - systemd-boot = { - enable = true; - }; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; - }; + loader.grub.device = "/dev/vda"; + initrd = { + availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + kernelModules = []; }; + kernelModules = []; + extraModulePackages = []; }; + networking.interfaces.ens3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + virtualisation.hypervGuest.enable = true; + time.timeZone = lib.mkDefault "Frankfurt"; fileSystems = { @@ -56,14 +52,17 @@ options = ["noexec" "defaults" "size=2G" "mode=755"]; }; "/nix" = { - device = "/dev/disk/by-partlabel/nix"; - options = ["noatime" "compress=zstd"]; + device = "/dev/disk/by-uuid/e4c4735d-bfdd-477f-bc43-d07510cb6a9a"; + fsType = "btrfs"; }; "/boot" = { - device = "/dev/disk/by-partlabel/boot"; + device = "/dev/disk/by-uuid/7ea63707-099d-4c21-90eb-a51bfa6d8ba5"; + fsType = "ext4"; }; }; + swapDevices = [ { device = "/dev/disk/by-uuid/00eb2d2e-4d7c-4e95-804d-e9ecb22679d4"; } ]; + zramSwap = { enable = true; algorithm = "zstd"; diff --git a/mixins/greet.nix b/mixins/greet.nix index 5c46792..755b7f8 100644 --- a/mixins/greet.nix +++ b/mixins/greet.nix @@ -1,4 +1,5 @@ { + config, pkgs, lib, ... @@ -6,28 +7,34 @@ user = "tzlil"; users.users.greeter.packages = [pkgs.sway]; - greetd = "${pkgs.greetd.greetd}/bin/greetd"; - gtkgreet = "${pkgs.greetd.gtkgreet}/bin/gtkgreet"; + greet = "${pkgs.greetd.wlgreet}/bin/wlgreet"; sway-kiosk = command: "${pkgs.sway}/bin/sway --unsupported-gpu --config ${pkgs.writeText "kiosk.config" '' output * bg #000000 solid_color exec "${command}; ${pkgs.sway}/bin/swaymsg exit" ''}"; in { - environment.etc."greetd/environments".text = - "sway\n" - + "$SHELL -l\n"; + options.greeter.initialSession = lib.mkOption { + type = lib.types.str; + default = "sh -c sway"; + }; - services.greetd = { - enable = true; - settings = { - default_session = { - inherit user; - command = sway-kiosk "${gtkgreet} -l &>/dev/null"; - }; - initial_session = { - inherit user; - command = "sh -c sway"; + config = { + environment.etc."greetd/environments".text = + "sway\n" + + "$SHELL -l\n"; + + services.greetd = { + enable = true; + settings = { + default_session = { + inherit user; + command = sway-kiosk "${greet} -l &>/dev/null"; + }; + initial_session = { + inherit user; + command = config.greeter.initialSession; + }; }; }; }; diff --git a/mixins/hyperland.nix b/mixins/hyperland.nix deleted file mode 100644 index 84cab6f..0000000 --- a/mixins/hyperland.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - pkgs, - lib, - config, - inputs, - ... -}: { - imports = [ - inputs.hyprland.nixosModules.default - ]; - config = { - programs.hyprland.enable = true; - }; -} \ No newline at end of file diff --git a/mixins/hyprland.nix b/mixins/hyprland.nix index 84cab6f..1a063d9 100644 --- a/mixins/hyprland.nix +++ b/mixins/hyprland.nix @@ -9,6 +9,12 @@ inputs.hyprland.nixosModules.default ]; config = { - programs.hyprland.enable = true; + programs.hyprland = { + enable = true; + xwayland = { + enable = false; + hidpi = false; + }; + }; }; } \ No newline at end of file diff --git a/profiles/network.nix b/profiles/network.nix index 1b3026b..40e31cc 100644 --- a/profiles/network.nix +++ b/profiles/network.nix @@ -19,6 +19,7 @@ 100.99.246.128 pc 100.105.242.70 phone 100.109.155.123 vm + 100.67.217.90 vps ''; }; diff --git a/profiles/user.nix b/profiles/user.nix index 514d303..7f0ec8b 100644 --- a/profiles/user.nix +++ b/profiles/user.nix @@ -16,7 +16,7 @@ owner = "tzlil"; group = "users"; }; - password.file = ../secrets/password.age; + # password.file = ../secrets/password.age; }; users.users.tzlil = { diff --git a/secrets/id_ed25519.age b/secrets/id_ed25519.age index 64ee68f..9d5883b 100644 --- a/secrets/id_ed25519.age +++ b/secrets/id_ed25519.age Binary files differdiff --git a/secrets/secrets.nix b/secrets/secrets.nix index 1020fc4..fd40ec5 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -2,9 +2,9 @@ let tzlil = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMDyzrs9sbstv3KFK5FV8qYlSknnEy8Cn+qch4dJLmHA"; vm = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHS6LK6rCmJCR/rKVJYVmJTL8fAdyJSLlgC3mesd6QVS"; - systems = [ vm ]; + vps = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMdOuj27GB703ZRKRqhytlaLJsKucaRa//yswxijAZT7"; + systems = [ vm vps ]; in { "id_ed25519.age".publicKeys = [ tzlil ] ++ systems; - "password.age".publicKeys = [ tzlil ] ++ systems; -} \ No newline at end of file +} |