From 69ac30f0b90461d7edb101e88208738f976853fb Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Wed, 19 Jun 2024 17:17:55 +0300 Subject: [PATCH] Add eirene bare metal config Signed-off-by: Nikolaos Karaolidis --- hosts/common/configs/git/default.nix | 7 ++++++ hosts/common/configs/gpg-agent/default.nix | 6 +++++ hosts/common/configs/nix-ld/default.nix | 7 ++++++ hosts/common/configs/ssh/default.nix | 8 +++++++ hosts/common/default.nix | 26 ++++++++++------------ hosts/common/scripts/impermanence.sh | 2 ++ hosts/eirene/base/default.nix | 13 +++++++++-- users/common/configs/hyprland/default.nix | 4 ++++ users/common/default.nix | 5 ++++- users/common/extra.nix | 10 ++++----- 10 files changed, 66 insertions(+), 22 deletions(-) create mode 100644 hosts/common/configs/git/default.nix create mode 100644 hosts/common/configs/gpg-agent/default.nix create mode 100644 hosts/common/configs/nix-ld/default.nix create mode 100644 hosts/common/configs/ssh/default.nix diff --git a/hosts/common/configs/git/default.nix b/hosts/common/configs/git/default.nix new file mode 100644 index 0000000..04e14ce --- /dev/null +++ b/hosts/common/configs/git/default.nix @@ -0,0 +1,7 @@ +{ + programs.git = { + enable = true; + lfs.enable = true; + }; +} + diff --git a/hosts/common/configs/gpg-agent/default.nix b/hosts/common/configs/gpg-agent/default.nix new file mode 100644 index 0000000..3a0b485 --- /dev/null +++ b/hosts/common/configs/gpg-agent/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: + +{ + programs.gnupg.agent.enable = true; +} + diff --git a/hosts/common/configs/nix-ld/default.nix b/hosts/common/configs/nix-ld/default.nix new file mode 100644 index 0000000..8cfe516 --- /dev/null +++ b/hosts/common/configs/nix-ld/default.nix @@ -0,0 +1,7 @@ +{ + programs.nix-ld = { + enable = true; + libraries = [ ]; + }; +} + diff --git a/hosts/common/configs/ssh/default.nix b/hosts/common/configs/ssh/default.nix new file mode 100644 index 0000000..36f983e --- /dev/null +++ b/hosts/common/configs/ssh/default.nix @@ -0,0 +1,8 @@ +{ + programs.ssh = { + knownHosts = { + eirene.publicKeyFile = ../../../eirene/secrets/ssh_host_ed25519_key.pub; + }; + }; +} + diff --git a/hosts/common/default.nix b/hosts/common/default.nix index ef78de8..9b834ef 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -7,6 +7,10 @@ ./configs/zsh ./configs/neovim ./configs/tmux + ./configs/ssh + ./configs/nix-ld + ./configs/git + ./configs/gpg-agent ]; fileSystems."/persist".neededForBoot = true; @@ -14,7 +18,7 @@ boot = { loader = { systemd-boot.enable = true; - timeout = 0; + timeout = 3; efi.canTouchEfiVariables = true; }; @@ -23,6 +27,7 @@ postDeviceCommands = lib.mkAfter (builtins.readFile ./scripts/impermanence.sh); }; + supportedFilesystems = [ "btrfs" "ntfs" ]; kernelParams = [ "loglevel=3" "quiet" ]; consoleLogLevel = 0; }; @@ -45,12 +50,11 @@ }; systemPackages = with pkgs; [ - nano tree - git ranger btop fastfetch + sops ]; }; @@ -62,16 +66,6 @@ defaultUserShell = pkgs.zsh; }; - programs = { - nix-ld = { - enable = true; - libraries = [ ]; - }; - ssh.knownHosts = { - eirene.publicKeyFile = ../eirene/secrets/ssh_host_ed25519_key.pub; - }; - }; - security.sudo.extraConfig = '' Defaults lecture = never ''; @@ -97,6 +91,10 @@ stateVersion = "24.05"; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix = { + settings.experimental-features = [ "nix-command" "flakes" ]; + gc.automatic = true; + }; + nixpkgs.config.allowUnfree = true; } diff --git a/hosts/common/scripts/impermanence.sh b/hosts/common/scripts/impermanence.sh index d53106e..525b32f 100644 --- a/hosts/common/scripts/impermanence.sh +++ b/hosts/common/scripts/impermanence.sh @@ -1,3 +1,5 @@ +#!/bin/sh + delete_subvolume_recursively() { IFS=$'\n' for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do diff --git a/hosts/eirene/base/default.nix b/hosts/eirene/base/default.nix index a365b7a..1f306b9 100644 --- a/hosts/eirene/base/default.nix +++ b/hosts/eirene/base/default.nix @@ -51,9 +51,18 @@ }; boot = { - kernelParams = [ "amd_pstate=active" "video=eDP:2560x1600@165" ]; + kernelParams = [ "amd_pstate=active" "video=eDP-1:2560x1600@165" ]; initrd.kernelModules = [ "amdgpu" ]; }; - home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{ wayland.windowManager.hyprland.settings.monitor = "eDP, 2560x1600@165, 0x0, 1"; }]; + home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{ wayland.windowManager.hyprland.settings = { + monitor = "eDP-1, 2560x1600@165, 0x0, 1.25"; + device = [ + { + name = "syna2ba6:00-06cb:ce44-touchpad"; + natural_scroll = "true"; + sensitivity = 0.5; + } + ]; + }; }]; } diff --git a/users/common/configs/hyprland/default.nix b/users/common/configs/hyprland/default.nix index 7bc31cb..f7e0dda 100644 --- a/users/common/configs/hyprland/default.nix +++ b/users/common/configs/hyprland/default.nix @@ -80,6 +80,10 @@ "$mod, mouse:273, resizewindow" ]; + input = { + "accel_profile" = "flat"; + }; + misc = { "disable_hyprland_logo" = true; "disable_splash_rendering" = true; diff --git a/users/common/default.nix b/users/common/default.nix index 7d3d1c9..11086a6 100644 --- a/users/common/default.nix +++ b/users/common/default.nix @@ -24,6 +24,7 @@ in sharedModules = [{ imports = [ inputs.impermanence.nixosModules.home-manager.impermanence + inputs.sops-nix.homeManagerModules.sops inputs.stylix.homeManagerModules.stylix ./configs/stylix ./configs/hyprland @@ -73,11 +74,13 @@ in ".local/share/zsh" ]; files = [ - ".local/share/sops-nix/key.txt" + ".config/sops-nix/key.txt" ]; allowOther = true; }; + sops.age.keyFile = "/persist${config.home}/.config/sops-nix/key.txt"; + programs.git = { userName = config.fullName; userEmail = config.email; diff --git a/users/common/extra.nix b/users/common/extra.nix index 73867ab..600cee7 100644 --- a/users/common/extra.nix +++ b/users/common/extra.nix @@ -1,24 +1,24 @@ { lib, ... }: let - userOptions = with lib; { config, ... }: { + userOptions = with lib; with types; { config, ... }: { options.email = mkOption { - type = types.nullOr types.str; + type = nullOr str; description = "Email address of the user."; }; options.fullName = mkOption { - type = types.nullOr types.str; + type = nullOr str; description = "Full name of the user."; }; options.wallpaper = mkOption { - type = types.path; + type = path; description = "Path to the user's wallpaper."; }; options.base16Scheme = mkOption { - type = types.path; + type = path; description = "Base16 scheme to use for the user's color palette."; }; };