Convert home-manager to flakes
Instead of calling the home manager directly in the user's list, we add a command for the user to invoke "hms" and have their environment setup in the way that Greg likes.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
{ nixpkgs, nurpkgs, home-manager, username ? builtins.getEnv "USER", ... }:
|
||||
|
||||
let
|
||||
homeDirectory = if username == "root" then "/root" else "/home/${username}";
|
||||
configDir = "${homeDirectory}/.config";
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
config.allowUnfree = true;
|
||||
config.xdg.configHome = configDir;
|
||||
overlays = [
|
||||
nurpkgs.overlay
|
||||
(import ../overlays)
|
||||
];
|
||||
};
|
||||
|
||||
nur = import nurpkgs {
|
||||
inherit pkgs;
|
||||
nur = pkgs;
|
||||
};
|
||||
|
||||
mkhome = system: gui:
|
||||
home-manager.lib.homeManagerConfiguration rec {
|
||||
inherit pkgs system username homeDirectory;
|
||||
stateVersion = "22.05";
|
||||
configuration = import ./home.nix username {
|
||||
inherit nur pkgs gui;
|
||||
inherit (pkgs) config lib stdenv;
|
||||
};
|
||||
};
|
||||
in {
|
||||
"aarch64-gui" = mkhome "aarch64-linux" true;
|
||||
"aarch64-nogui" = mkhome "aarch64-linux" false;
|
||||
"x86_64-gui" = mkhome "x86_64-linux" true;
|
||||
"x86_64-nogui" = mkhome "x86_64-linux" false;
|
||||
}
|
||||
+6
-5
@@ -1,7 +1,7 @@
|
||||
name: { pkgs, lib, nixosConfig, ...}:
|
||||
name: { pkgs, lib, gui, ...}:
|
||||
|
||||
let
|
||||
guiImports = if nixosConfig.greg.gnome.enable then
|
||||
guiImports = if gui then
|
||||
[ ./gui ] else [];
|
||||
|
||||
in {
|
||||
@@ -17,7 +17,8 @@ in {
|
||||
] ++ guiImports;
|
||||
|
||||
|
||||
home.username = name;
|
||||
home.homeDirectory = if name == "root" then "/root" else "/home/${name}";
|
||||
home.stateVersion = "21.11";
|
||||
home.stateVersion = "22.05";
|
||||
home.packages = [
|
||||
pkgs.hms
|
||||
];
|
||||
}
|
||||
|
||||
+2
-4
@@ -1,8 +1,6 @@
|
||||
{ pkgs, config, nixosConfig, lib, ... }:
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
enable = nixosConfig.greg.gnome.enable;
|
||||
in {
|
||||
{
|
||||
programs.xonsh = {
|
||||
enable = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user