Added pi4 to systems, moved getSecret function to lib

This commit is contained in:
Martin Berg Alstad 2025-04-12 20:25:10 +02:00
parent 6ca92c8537
commit 0649473709
Signed by: martials
GPG Key ID: 706F53DD087A91DE
5 changed files with 17 additions and 11 deletions

View File

@ -1,6 +1,6 @@
# NixOS Configurations # 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) ![Screenshot of desktop](./.gitea/assets/desktop.png)

View File

@ -37,9 +37,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Bar # Bar
hyprpanel = { hyprpanel.url = "github:Jas-SinghFSU/HyprPanel";
url = "github:Jas-SinghFSU/HyprPanel";
};
# Spotify # Spotify
spicetify-nix = { spicetify-nix = {
url = "github:Gerg-L/spicetify-nix"; url = "github:Gerg-L/spicetify-nix";
@ -87,6 +85,12 @@
hostName = "thinkpad"; hostName = "thinkpad";
system = "x86_64-linux"; system = "x86_64-linux";
} }
{
hostName = "pi4";
system = "aarch64-linux";
enableWayland = false;
}
# TODO Homelab config
]; ];
in in
@ -110,7 +114,9 @@
password = "temp"; password = "temp";
}, },
version ? common.version, version ? common.version,
enableWayland ? true,
}: }:
{ {
name = hostName; name = hostName;
value = nixpkgs.lib.nixosSystem { value = nixpkgs.lib.nixosSystem {
@ -124,6 +130,7 @@
lib lib
hostName hostName
version version
enableWayland
; ;
isDarwin = false; isDarwin = false;
}; };
@ -144,6 +151,7 @@
libHm libHm
hostName hostName
version version
enableWayland
; ;
}; };
users.${user.name} = import ./hosts/${hostName}/home-manager; users.${user.name} = import ./hosts/${hostName}/home-manager;

View File

@ -82,7 +82,7 @@
weather = { weather = {
unit = "metric"; unit = "metric";
location = "Bergen, Norway"; location = "Bergen, Norway";
key = common.secret.weatherApiKey lib; key = with lib.custom; getSecret (relativeToRoot "shared/secrets/weather-api-key");
}; };
}; };

View File

@ -2,8 +2,11 @@
{ lib, ... }: { lib, ... }:
{ {
getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (builtins.readFile filePath));
# use path relative to the root of the project # use path relative to the root of the project
relativeToRoot = lib.path.append ../.; relativeToRoot = lib.path.append ../.;
scanPaths = scanPaths =
path: path:
builtins.map (f: (path + "/${f}")) ( builtins.map (f: (path + "/${f}")) (

View File

@ -3,7 +3,7 @@ rec {
browser = "zen"; browser = "zen";
calculator = "gnome-calculator"; calculator = "gnome-calculator";
fileManager = "nautilus"; fileManager = "nautilus";
imageViewer = "loupe"; imageViewer = "imv";
lockScreen = "hyprlock"; lockScreen = "hyprlock";
terminal = "kitty"; terminal = "kitty";
}; };
@ -31,9 +31,4 @@ rec {
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.version = "24.11"; 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));
} }