From 06494737096a9aa251dda7880a31fc528791dde6 Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Sat, 12 Apr 2025 20:25:10 +0200 Subject: [PATCH] :sparkles: Added pi4 to systems, moved getSecret function to lib --- README.md | 2 +- flake.nix | 14 +++++++++++--- .../home-manager/hyprland/hyprpanel/default.nix | 2 +- lib/default.nix | 3 +++ shared/common.nix | 7 +------ 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 90098e9..cd278b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # NixOS Configurations -My NixOS configurations with dotfiles for my desktop +My NixOS configurations with dotfiles for my systems. ![Screenshot of desktop](./.gitea/assets/desktop.png) diff --git a/flake.nix b/flake.nix index 03f7a5b..534c7e6 100644 --- a/flake.nix +++ b/flake.nix @@ -37,9 +37,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; # Bar - hyprpanel = { - url = "github:Jas-SinghFSU/HyprPanel"; - }; + hyprpanel.url = "github:Jas-SinghFSU/HyprPanel"; # Spotify spicetify-nix = { url = "github:Gerg-L/spicetify-nix"; @@ -87,6 +85,12 @@ hostName = "thinkpad"; system = "x86_64-linux"; } + { + hostName = "pi4"; + system = "aarch64-linux"; + enableWayland = false; + } + # TODO Homelab config ]; in @@ -110,7 +114,9 @@ password = "temp"; }, version ? common.version, + enableWayland ? true, }: + { name = hostName; value = nixpkgs.lib.nixosSystem { @@ -124,6 +130,7 @@ lib hostName version + enableWayland ; isDarwin = false; }; @@ -144,6 +151,7 @@ libHm hostName version + enableWayland ; }; users.${user.name} = import ./hosts/${hostName}/home-manager; diff --git a/hosts/desktop/home-manager/hyprland/hyprpanel/default.nix b/hosts/desktop/home-manager/hyprland/hyprpanel/default.nix index 08add4a..784143b 100644 --- a/hosts/desktop/home-manager/hyprland/hyprpanel/default.nix +++ b/hosts/desktop/home-manager/hyprland/hyprpanel/default.nix @@ -82,7 +82,7 @@ weather = { unit = "metric"; location = "Bergen, Norway"; - key = common.secret.weatherApiKey lib; + key = with lib.custom; getSecret (relativeToRoot "shared/secrets/weather-api-key"); }; }; diff --git a/lib/default.nix b/lib/default.nix index 6fb3445..5093e51 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -2,8 +2,11 @@ { lib, ... }: { + getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (builtins.readFile filePath)); + # use path relative to the root of the project relativeToRoot = lib.path.append ../.; + scanPaths = path: builtins.map (f: (path + "/${f}")) ( diff --git a/shared/common.nix b/shared/common.nix index 519a3c4..94596a2 100644 --- a/shared/common.nix +++ b/shared/common.nix @@ -3,7 +3,7 @@ rec { browser = "zen"; calculator = "gnome-calculator"; fileManager = "nautilus"; - imageViewer = "loupe"; + imageViewer = "imv"; lockScreen = "hyprlock"; terminal = "kitty"; }; @@ -31,9 +31,4 @@ rec { # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.version = "24.11"; - - secret.weatherApiKey = lib: loadSecret lib ./secrets/weather-api-key; - - loadSecret = - lib: filePath: lib.strings.trim (lib.strings.removeSuffix "\n" (builtins.readFile filePath)); }