From 24454badb983a9c4c2c528263b766fee91bab5a5 Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 12 Dec 2023 19:29:04 +0900 Subject: [PATCH] Add a "small" home-manager image for the raspberry pi's --- flake.nix | 6 +++--- home-manager/small.nix | 33 +++++++++++++++++++++++++++++++++ lib/default.nix | 5 +++-- 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 home-manager/small.nix diff --git a/flake.nix b/flake.nix index 1e84a585..a73c2961 100644 --- a/flake.nix +++ b/flake.nix @@ -54,9 +54,9 @@ "albert@framework-server" = libx.mkHome { hostname = "framework-server"; }; # "albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; desktop = "gnome"; }; "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "green"; }; - "albert@nixos-rpi4-01" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; }; - "albert@nixos-rpi4-02" = libx.mkHome { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; }; - "albert@nixos-rpi4-03" = libx.mkHome { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; }; + "albert@nixos-rpi4-01" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; type = "small"; }; + "albert@nixos-rpi4-02" = libx.mkHome { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; type = "small"; }; + "albert@nixos-rpi4-03" = libx.mkHome { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; type = "small"; }; }; deploy.nodes = { osaka-linode-01 = libx.deploy { hostname = "osaka-linode-01"; }; diff --git a/home-manager/small.nix b/home-manager/small.nix new file mode 100644 index 00000000..e92b531d --- /dev/null +++ b/home-manager/small.nix @@ -0,0 +1,33 @@ +{ lib, config, pkgs, inputs, hostname, platform, username, desktop, theme, hmStateVersion, ... }: { + imports = [ + # Common configs + ./common/software/cli/bash.nix + ./common/software/cli/git.nix + ./common/software/cli/neovim.nix + ./common/software/cli/ssh.nix + + ./common/software/cli/themes/${theme}/btop.nix + + # User configs + ./users/${username} + ] + ++ lib.optional (builtins.isString desktop) ./common/software/gui # GUI packages + ++ lib.optional (builtins.isString desktop) ./common/desktops/${desktop} # Machine-agnostic desktop configs + ++ lib.optional (builtins.isString desktop) ./hosts/${hostname}/desktops/${desktop} # Machine-specific desktop configs + ; + + home = { + inherit username; + stateVersion = hmStateVersion; + homeDirectory = "/home/${username}"; + sessionPath = [ "$HOME/.local/bin" ]; + }; + }; + + nixpkgs = { + overlays = [ + # Currently in use in the Firefox config + inputs.nur.overlay + ]; + }; +} diff --git a/lib/default.nix b/lib/default.nix index 962d980e..e15194fe 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -29,12 +29,13 @@ username ? "albert", desktop ? null, platform ? "x86_64-linux", - theme ? "default" + theme ? "default", + type ? "default" }: inputs.home-manager.lib.homeManagerConfiguration { pkgs = inputs.nixpkgs.legacyPackages.${platform}; extraSpecialArgs = { inherit inputs outputs desktop hostname platform username hmStateVersion theme; }; modules = [ - ../home-manager + ../home-manager/${type}.nix ]; };