Skip to content

Commit

Permalink
Use sys lib from commons flake
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Jan 3, 2024
1 parent 9e16a5c commit d492a6a
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 34 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions home/base/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{ config, lib, ... }:

let

inherit (config.custom.base.non-nixos) isDarwin;

in

{
home = {
homeDirectory = lib.mkDefault "/home/${config.home.username}";
Expand All @@ -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;
};
Expand Down
4 changes: 1 addition & 3 deletions home/base/non-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ in
enable = mkEnableOption "Config for non NixOS systems";

installNix = mkEnableOption "Nix installation" // { default = true; };

isDarwin = mkEnableOption "Darwin architecture (MacOS)";
};
};

Expand Down Expand Up @@ -59,6 +57,6 @@ in
# End Nix
'';

targets.genericLinux.enable = !cfg.isDarwin;
targets.genericLinux.enable = config.lib.custom.sys.isLinux;
};
}
2 changes: 1 addition & 1 deletion home/base/system/filesystems/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion home/base/system/udiskie/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ config, ... }:

{
services.udiskie.enable = !config.custom.base.non-nixos.isDarwin;
services.udiskie.enable = config.lib.custom.sys.isLinux;
}
2 changes: 1 addition & 1 deletion home/roles/graphics/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in
home.packages = with pkgs; [
gimp
]
++ optionals (!config.custom.base.non-nixos.isDarwin) [
++ optionals config.lib.custom.sys.isLinux [
sxiv
];
};
Expand Down
2 changes: 1 addition & 1 deletion home/roles/office/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
};
Expand Down
10 changes: 5 additions & 5 deletions home/roles/web/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let

cfg = config.custom.roles.web;

inherit (config.custom.base.non-nixos) isDarwin;
inherit (config.lib.custom.sys) isLinux;

in

Expand All @@ -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
Expand All @@ -36,7 +36,7 @@ in
ublock-origin
];
};
roles.web.nextcloud-client.enable = !isDarwin;
roles.web.nextcloud-client.enable = isLinux;
};

home.packages = with pkgs; [
Expand All @@ -45,7 +45,7 @@ in
bind
wget
]
++ optionals (!isDarwin) [
++ optionals isLinux [
# Messengers
signal-desktop
telegram-desktop
Expand All @@ -55,6 +55,6 @@ in
freetube
];

programs.chromium.enable = !isDarwin;
programs.chromium.enable = isLinux;
};
}
2 changes: 1 addition & 1 deletion home/users/christian/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion home/users/christian/shell/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 1 addition & 5 deletions hosts/macos/home-chr.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
custom = {
base.non-nixos = {
enable = true;
isDarwin = true;
};

base.non-nixos.enable = true;
users.christian.enable = true;

roles = {
Expand Down
5 changes: 0 additions & 5 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}

0 comments on commit d492a6a

Please sign in to comment.