From 3f99d555413763b7680c9cde0425bed9afd15478 Mon Sep 17 00:00:00 2001 From: cnst Date: Mon, 29 Jul 2024 20:08:44 +0200 Subject: [PATCH] kanske? --- home/core/gui/hypr/default.nixbak | 23 ------ home/core/gui/hypr/land/appearance.nix | 4 -- home/core/gui/hypr/land/inputs.nix | 1 - home/users/cnst/home.nix | 2 +- nixos/hosts/cnix/default.nix | 96 +++++++++++++------------- nixos/hosts/cnix/substituters.nix | 28 ++++++++ nixos/services/greetd/default.nix | 23 +++--- nixos/services/openssh/default.nix | 2 - 8 files changed, 90 insertions(+), 89 deletions(-) delete mode 100644 home/core/gui/hypr/default.nixbak create mode 100644 nixos/hosts/cnix/substituters.nix diff --git a/home/core/gui/hypr/default.nixbak b/home/core/gui/hypr/default.nixbak deleted file mode 100644 index 3bafd91b..00000000 --- a/home/core/gui/hypr/default.nixbak +++ /dev/null @@ -1,23 +0,0 @@ -{ - wayland.windowManager.hyprland = { - enable = true; - xwayland.enable = true; - settings = { - source = [ - "./land/appearance.conf" - "./land/inputs.conf" - "./land/keybinds.conf" - "./land/rules.conf" - "./land/startup.conf" - ]; - }; - - systemd = { - variables = ["--all"]; - extraCommands = [ - "systemctl --user stop graphical-session.target" - "systemctl --user start hyprland-session.target" - ]; - }; - }; -} diff --git a/home/core/gui/hypr/land/appearance.nix b/home/core/gui/hypr/land/appearance.nix index 557c48da..00a86bc3 100644 --- a/home/core/gui/hypr/land/appearance.nix +++ b/home/core/gui/hypr/land/appearance.nix @@ -12,7 +12,6 @@ allow_tearing = false; resize_on_border = true; }; - decoration = { rounding = 0; blur = { @@ -21,13 +20,11 @@ passes = 1; vibrancy = 0.1696; }; - drop_shadow = false; shadow_range = 4; shadow_render_power = 3; # col.shadow = rgba(1a1a1aee) }; - animations = { enabled = true; bezier = [ @@ -42,7 +39,6 @@ "workspaces, 1, 3, default" ]; }; - dwindle = { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below diff --git a/home/core/gui/hypr/land/inputs.nix b/home/core/gui/hypr/land/inputs.nix index 5bbce09c..0448f994 100644 --- a/home/core/gui/hypr/land/inputs.nix +++ b/home/core/gui/hypr/land/inputs.nix @@ -9,7 +9,6 @@ # env = HYPRCURSOR_SIZE,28 # env = XCURSOR_THEME,macOS # env = XCURSOR_SIZE,28 - # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input = { follow_mouse = 1; diff --git a/home/users/cnst/home.nix b/home/users/cnst/home.nix index 9c9f2582..7dffa8fb 100644 --- a/home/users/cnst/home.nix +++ b/home/users/cnst/home.nix @@ -32,5 +32,5 @@ systemd.user.startServices = "sd-switch"; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "24.05"; + home.stateVersion = "23.11"; } diff --git a/nixos/hosts/cnix/default.nix b/nixos/hosts/cnix/default.nix index fc67313f..49d69dbf 100644 --- a/nixos/hosts/cnix/default.nix +++ b/nixos/hosts/cnix/default.nix @@ -1,14 +1,15 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - system, - ... -}: let +{ inputs +, outputs +, lib +, config +, pkgs +, system +, ... +}: +let ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; -in { +in +{ users.users.cnst = { isNormalUser = true; shell = pkgs.zsh; @@ -40,51 +41,50 @@ in { ./imports.nix ./system.nix ./hardware-configuration.nix + ./substituters.nix ]; home-manager.users.cnst = import ../../../home/users/cnst/home.nix; - nix = let - flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; - in { + + nix = { + # pin the registry to avoid downloading and evaling a new nixpkgs version every time + registry = lib.mapAttrs (_: v: { flake = v; }) inputs; + + # set the path for channels compat + nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; + settings = { - auto-optimise-store = lib.mkDefault true; + auto-optimise-store = true; + builders-use-substitutes = true; warn-dirty = false; - # Enable flakes and new 'nix' command - experimental-features = [ - "nix-command" - "flakes" - ]; - # Opinionated: disable global registry - flake-registry = ""; - # Workaround for https://github.com/NixOS/nix/issues/9574 - nix-path = config.nix.nixPath; + experimental-features = [ "nix-command" "flakes" ]; + flake-registry = "/etc/nix/registry.json"; + + # for direnv GC roots + keep-derivations = true; + keep-outputs = true; + + trusted-users = [ "root" "@wheel" ]; }; - # Opinionated: disable channels - channel.enable = false; - # Opinionated: make flake registry and nix path match flake inputs - registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; - }; + # Bootloader + boot.loader = { + systemd-boot.enable = lib.mkForce false; + efi.canTouchEfiVariables = true; + }; + boot.lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; - # Bootloader - boot.loader = { - systemd-boot.enable = lib.mkForce false; - efi.canTouchEfiVariables = true; - }; - boot.lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; + users.users.cnst.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGe3s7WbaM0aZTYHCE1ugiG/SxFXLSbWcLAWceFotpuh toothpick@nixos" + ]; - users.users.cnst.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGe3s7WbaM0aZTYHCE1ugiG/SxFXLSbWcLAWceFotpuh toothpick@nixos" - ]; + environment.sessionVariables = { + FLAKE = "/home/cnst/.nix-config"; + }; - environment.sessionVariables = { - FLAKE = "/home/cnst/.nix-config"; - }; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "24.05"; -} + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = lib.mkDefault "23.11"; + } diff --git a/nixos/hosts/cnix/substituters.nix b/nixos/hosts/cnix/substituters.nix new file mode 100644 index 00000000..a892de4e --- /dev/null +++ b/nixos/hosts/cnix/substituters.nix @@ -0,0 +1,28 @@ +{ + nix.settings = { + substituters = [ + # high priority since it's almost always used + "https://cache.nixos.org?priority=10" + + "https://anyrun.cachix.org" + "https://fufexan.cachix.org" + "https://helix.cachix.org" + "https://hyprland.cachix.org" + "https://nix-community.cachix.org" + "https://nix-gaming.cachix.org" + "https://yazi.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + + "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" + "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY=" + "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + "yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k=" + ]; + }; +} diff --git a/nixos/services/greetd/default.nix b/nixos/services/greetd/default.nix index 29247ecf..1219d88b 100644 --- a/nixos/services/greetd/default.nix +++ b/nixos/services/greetd/default.nix @@ -1,16 +1,19 @@ {pkgs, ...}: { - services.greetd = { + # greetd display manager + services.greetd = let + session = { + command = "${pkgs.hyprland}/bin/Hyprland"; + user = "cnst"; + }; + in { enable = true; settings = { - # AUTOLOGIN - # initial_session = { - # command = "${pkgs.hyprland}/bin/Hyprland"; - # user = "cnst"; - # }; - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session --asterisks"; - user = "greeter"; - }; + terminal.vt = 1; + default_session = session; + initial_session = session; }; }; + + # unlock GPG keyring on login + security.pam.services.greetd.enableGnomeKeyring = true; } diff --git a/nixos/services/openssh/default.nix b/nixos/services/openssh/default.nix index b5330504..cc414dbe 100644 --- a/nixos/services/openssh/default.nix +++ b/nixos/services/openssh/default.nix @@ -1,9 +1,7 @@ { services.openssh = { enable = true; - ports = [22]; settings = { - AllowUsers = ["toothpick" "cnst"]; PermitRootLogin = "no"; PasswordAuthentication = false; };