diff --git a/flake.lock b/flake.lock index 3fc15a62..3bf2c81b 100644 --- a/flake.lock +++ b/flake.lock @@ -97,11 +97,11 @@ ] }, "locked": { - "lastModified": 1702429194, - "narHash": "sha256-yMSXrg8gYB2WzjCDmr1kku7KBVjX45cW9bZK6SfRsGU=", + "lastModified": 1704275503, + "narHash": "sha256-fU0xpfYLIQd4NgtuDjH+Wl/+tyueJiQpWpeBuOM3Lbk=", "owner": "rake5k", "repo": "flake-commons", - "rev": "d58dc9b6d89f619d619e6a0b08831c5f44705973", + "rev": "2a8632641673bf969f5ac8e8e038a87d8d95f05b", "type": "github" }, "original": { diff --git a/home/base/default.nix b/home/base/default.nix index a43f3021..35860530 100644 --- a/home/base/default.nix +++ b/home/base/default.nix @@ -1,11 +1,5 @@ { config, lib, ... }: -let - - inherit (config.custom.base.non-nixos) isDarwin; - -in - { home = { homeDirectory = lib.mkDefault "/home/${config.home.username}"; @@ -17,7 +11,7 @@ in enableNixpkgsReleaseCheck = true; }; - xdg.userDirs = lib.mkIf (!isDarwin) { + xdg.userDirs = lib.mkIf config.lib.custom.sys.isLinux { enable = true; createDirectories = true; }; diff --git a/home/base/non-nixos/default.nix b/home/base/non-nixos/default.nix index 1a292b15..4035d773 100644 --- a/home/base/non-nixos/default.nix +++ b/home/base/non-nixos/default.nix @@ -16,8 +16,6 @@ in enable = mkEnableOption "Config for non NixOS systems"; installNix = mkEnableOption "Nix installation" // { default = true; }; - - isDarwin = mkEnableOption "Darwin architecture (MacOS)"; }; }; @@ -59,6 +57,6 @@ in # End Nix ''; - targets.genericLinux.enable = !cfg.isDarwin; + targets.genericLinux.enable = config.lib.custom.sys.isLinux; }; } diff --git a/home/base/system/filesystems/default.nix b/home/base/system/filesystems/default.nix index 0edba9c4..630c5adf 100644 --- a/home/base/system/filesystems/default.nix +++ b/home/base/system/filesystems/default.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: -lib.mkIf (!config.custom.base.non-nixos.isDarwin) { +lib.mkIf config.lib.custom.sys.isLinux { home.packages = with pkgs; [ parted exfat diff --git a/home/base/system/udiskie/default.nix b/home/base/system/udiskie/default.nix index 39cacc8d..b6536bbf 100644 --- a/home/base/system/udiskie/default.nix +++ b/home/base/system/udiskie/default.nix @@ -1,5 +1,5 @@ { config, ... }: { - services.udiskie.enable = !config.custom.base.non-nixos.isDarwin; + services.udiskie.enable = config.lib.custom.sys.isLinux; } diff --git a/home/roles/graphics/default.nix b/home/roles/graphics/default.nix index 70b91698..8941b275 100644 --- a/home/roles/graphics/default.nix +++ b/home/roles/graphics/default.nix @@ -19,7 +19,7 @@ in home.packages = with pkgs; [ gimp ] - ++ optionals (!config.custom.base.non-nixos.isDarwin) [ + ++ optionals config.lib.custom.sys.isLinux [ sxiv ]; }; diff --git a/home/roles/office/default.nix b/home/roles/office/default.nix index 0d2d2201..1504faa3 100644 --- a/home/roles/office/default.nix +++ b/home/roles/office/default.nix @@ -21,7 +21,7 @@ in home.packages = with pkgs; [ reveal-md ] - ++ optionals (!config.custom.base.non-nixos.isDarwin) [ + ++ optionals config.lib.custom.sys.isLinux [ libreoffice ]; }; diff --git a/home/roles/web/default.nix b/home/roles/web/default.nix index 3c99c678..416025b0 100644 --- a/home/roles/web/default.nix +++ b/home/roles/web/default.nix @@ -6,7 +6,7 @@ let cfg = config.custom.roles.web; - inherit (config.custom.base.non-nixos) isDarwin; + inherit (config.lib.custom.sys) isLinux; in @@ -21,7 +21,7 @@ in custom = { programs.firefox = { # See: https://github.com/NixOS/nixpkgs/issues/71689 - enable = !isDarwin; + enable = isLinux; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ facebook-container istilldontcareaboutcookies @@ -36,7 +36,7 @@ in ublock-origin ]; }; - roles.web.nextcloud-client.enable = !isDarwin; + roles.web.nextcloud-client.enable = isLinux; }; home.packages = with pkgs; [ @@ -45,7 +45,7 @@ in bind wget ] - ++ optionals (!isDarwin) [ + ++ optionals isLinux [ # Messengers signal-desktop telegram-desktop @@ -55,6 +55,6 @@ in freetube ]; - programs.chromium.enable = !isDarwin; + programs.chromium.enable = isLinux; }; } diff --git a/home/users/christian/default.nix b/home/users/christian/default.nix index 9bda07a2..90f4ee31 100644 --- a/home/users/christian/default.nix +++ b/home/users/christian/default.nix @@ -29,7 +29,7 @@ in fonts.enable = !config.custom.roles.mobile.enable; git.enable = true; gpg.enable = true; - hardware = mkIf (!config.custom.base.non-nixos.isDarwin) { + hardware = mkIf config.lib.custom.sys.isLinux { kmonad.enable = !config.custom.roles.mobile.enable; xbindkeys.enable = !config.custom.roles.mobile.enable; }; diff --git a/home/users/christian/shell/zsh/default.nix b/home/users/christian/shell/zsh/default.nix index b6e03a32..231908c0 100644 --- a/home/users/christian/shell/zsh/default.nix +++ b/home/users/christian/shell/zsh/default.nix @@ -21,7 +21,7 @@ in enableAutosuggestions = true; enableCompletion = true; autocd = true; - completionInit = optionalString config.custom.base.non-nixos.isDarwin "autoload -U compinit && compinit -u"; + completionInit = optionalString config.lib.custom.sys.isDarwin "autoload -U compinit && compinit -u"; dotDir = ".config/zsh"; dirHashes = { bb = "/mnt/bluecare/bluecare"; diff --git a/hosts/macos/home-chr.nix b/hosts/macos/home-chr.nix index 2f5beb09..e5b8793d 100644 --- a/hosts/macos/home-chr.nix +++ b/hosts/macos/home-chr.nix @@ -1,10 +1,6 @@ { custom = { - base.non-nixos = { - enable = true; - isDarwin = true; - }; - + base.non-nixos.enable = true; users.christian.enable = true; roles = { diff --git a/lib/default.nix b/lib/default.nix index f909a8de..40a129df 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -95,9 +95,4 @@ in mkNixos = simpleWrapper ./builders/mkNixos.nix; mkNixDarwin = simpleWrapper ./builders/mkNixDarwin.nix; mkNixOnDroid = simpleWrapper ./builders/mkNixOnDroid.nix; - mkSys = system: - { - isLinux = lib.hasInfix "linux" system; - isDarwin = lib.hasInfix "darwin" system; - }; }