diff --git a/flake-parts/home-manager/modules.nix b/flake-parts/home-manager/modules.nix index 4077994..345dc84 100644 --- a/flake-parts/home-manager/modules.nix +++ b/flake-parts/home-manager/modules.nix @@ -9,19 +9,24 @@ ... }: { flake.homeManagerModules = let - modules = self.lib.importDirToAttrs ../../home-manager/modules; - non-darwin-modules = lib.filterAttrs (n: v: !(lib.hasInfix "darwin" n)) modules; + modules = self.lib.importDirToAttrs ../../home-manager; + non-specific-modules = lib.filterAttrs (n: v: (!(lib.hasInfix "darwin" n) && !(lib.hasInfix "linux" n))) modules; darwin-modules = lib.filterAttrs (n: v: (lib.hasInfix "darwin" n)) modules; + linux-modules = lib.filterAttrs (n: v: (lib.hasInfix "linux" n)) modules; in { default = { - imports = builtins.attrValues non-darwin-modules; + imports = builtins.attrValues non-specific-modules; }; darwin = { imports = builtins.attrValues darwin-modules; }; + linux = { + imports = builtins.attrValues linux-modules; + }; + nixpkgs-config = { nixpkgs.config.allowUnfreePredicate = _: true; nixpkgs.config.allowUnsupportedSystem = true; diff --git a/flake-parts/home-manager/users.nix b/flake-parts/home-manager/users.nix index 134447b..81eef81 100644 --- a/flake-parts/home-manager/users.nix +++ b/flake-parts/home-manager/users.nix @@ -26,7 +26,10 @@ }; homeManagerModules.user-willem-linux = { - imports = [self.homeManagerModules.user-willem]; + imports = [ + self.homeManagerModules.user-willem + self.homeManagerModules.linux + ]; home.homeDirectory = "/home/willem"; }; diff --git a/home-manager/modules/custom/nixpkgs.nix b/home-manager/modules/nixpkgs.nix similarity index 100% rename from home-manager/modules/custom/nixpkgs.nix rename to home-manager/modules/nixpkgs.nix diff --git a/home-manager/modules/profiles/user/willem/accounts.nix b/home-manager/profiles/willem/accounts.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/accounts.nix rename to home-manager/profiles/willem/accounts.nix diff --git a/home-manager/modules/profiles/user/willem/base.nix b/home-manager/profiles/willem/base.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/base.nix rename to home-manager/profiles/willem/base.nix diff --git a/home-manager/modules/profiles/user/willem/darwin/base.nix b/home-manager/profiles/willem/darwin/base.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/darwin/base.nix rename to home-manager/profiles/willem/darwin/base.nix diff --git a/home-manager/modules/profiles/user/willem/darwin/finder.nix b/home-manager/profiles/willem/darwin/finder.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/darwin/finder.nix rename to home-manager/profiles/willem/darwin/finder.nix diff --git a/home-manager/modules/profiles/user/willem/darwin/iterm2.nix b/home-manager/profiles/willem/darwin/iterm2.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/darwin/iterm2.nix rename to home-manager/profiles/willem/darwin/iterm2.nix diff --git a/home-manager/modules/profiles/user/willem/darwin/keybinds.nix b/home-manager/profiles/willem/darwin/keybinds.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/darwin/keybinds.nix rename to home-manager/profiles/willem/darwin/keybinds.nix diff --git a/home-manager/modules/profiles/user/willem/darwin/launchd.nix b/home-manager/profiles/willem/darwin/launchd.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/darwin/launchd.nix rename to home-manager/profiles/willem/darwin/launchd.nix diff --git a/home-manager/profiles/willem/linux/base.nix b/home-manager/profiles/willem/linux/base.nix new file mode 100644 index 0000000..7af05e4 --- /dev/null +++ b/home-manager/profiles/willem/linux/base.nix @@ -0,0 +1,22 @@ +{ + config, + pkgs, + lib, + ... +}: { + home.file.".gnupg/gpg-agent.conf" = { + text = '' + default-cache-ttl 30 + max-cache-ttl 600 + ''; + }; + + programs.zsh.shellAliases = { + nrs = "nixos-rebuild switch --flake ${config.home.homeDirectory}/.config/dotfiles.nix#"; + nbs = "nixos-rebuild build --flake ${config.home.homeDirectory}/.config/dotfiles.nix#"; + }; + + home.packages = with pkgs; [ + gcc-arm-embedded + ]; +} diff --git a/home-manager/profiles/willem/linux/services.nix b/home-manager/profiles/willem/linux/services.nix new file mode 100644 index 0000000..ede8b65 --- /dev/null +++ b/home-manager/profiles/willem/linux/services.nix @@ -0,0 +1,40 @@ +{ + config, + pkgs, + lib, + ... +}: { + services = { + gpg-agent = { + enable = true; + enableSshSupport = true; + enableZshIntegration = true; + defaultCacheTtl = 30; + maxCacheTtl = 600; + }; + emacs = { + enable = true; + package = + if config.programs.emacs.enable + then config.programs.emacs.finalPackage + else pkgs.emacs; + client.enable = true; + defaultEditor = true; + startWithUserSession = true; + }; + }; + + systemd.user.services = { + offlineimap = { + Unit = { + Description = "Runs offlineimap to get email every 15 minutes."; + }; + + Service = { + ExecStart = "${pkgs.offlineimap}/bin/offlineimap"; + RestartSec = "15min"; + Restart = "always"; + }; + }; + }; +} diff --git a/home-manager/modules/profiles/user/willem/packages.nix b/home-manager/profiles/willem/packages.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/packages.nix rename to home-manager/profiles/willem/packages.nix diff --git a/home-manager/modules/profiles/user/willem/programs/default.nix b/home-manager/profiles/willem/programs/default.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/programs/default.nix rename to home-manager/profiles/willem/programs/default.nix diff --git a/home-manager/modules/profiles/user/willem/programs/emacs/default.nix b/home-manager/profiles/willem/programs/emacs/default.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/programs/emacs/default.nix rename to home-manager/profiles/willem/programs/emacs/default.nix diff --git a/home-manager/modules/profiles/user/willem/programs/emacs/early-init.el b/home-manager/profiles/willem/programs/emacs/early-init.el similarity index 100% rename from home-manager/modules/profiles/user/willem/programs/emacs/early-init.el rename to home-manager/profiles/willem/programs/emacs/early-init.el diff --git a/home-manager/modules/profiles/user/willem/programs/emacs/init.el b/home-manager/profiles/willem/programs/emacs/init.el similarity index 100% rename from home-manager/modules/profiles/user/willem/programs/emacs/init.el rename to home-manager/profiles/willem/programs/emacs/init.el diff --git a/home-manager/modules/profiles/user/willem/programs/firefox.nix b/home-manager/profiles/willem/programs/firefox.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/programs/firefox.nix rename to home-manager/profiles/willem/programs/firefox.nix diff --git a/home-manager/modules/profiles/user/willem/programs/zsh.nix b/home-manager/profiles/willem/programs/zsh.nix similarity index 100% rename from home-manager/modules/profiles/user/willem/programs/zsh.nix rename to home-manager/profiles/willem/programs/zsh.nix diff --git a/nixos/hosts/zeus.utmvm.nix b/nixos/hosts/zeus.utmvm.nix index 470b45d..7c6fb2b 100644 --- a/nixos/hosts/zeus.utmvm.nix +++ b/nixos/hosts/zeus.utmvm.nix @@ -1,9 +1,5 @@ {pkgs, ...}: { - imports = [ - ../profiles/desktop.nix - ../profiles/gnome.nix - ../profiles/linux-common.nix - ]; + imports = [../profiles/linux/gnome.nix]; boot.extraModulePackages = []; diff --git a/nixos/profiles/linux/base.nix b/nixos/profiles/linux/base.nix index 2074ec1..ba37d6d 100644 --- a/nixos/profiles/linux/base.nix +++ b/nixos/profiles/linux/base.nix @@ -1,5 +1,5 @@ {pkgs, ...}: { - imports = [./common.nix]; + imports = [../common.nix]; console.keyMap = "colemak";