diff --git a/modules/home/base/default.nix b/modules/home/base/default.nix index 85767c4..0bf9d2a 100644 --- a/modules/home/base/default.nix +++ b/modules/home/base/default.nix @@ -1,12 +1,16 @@ -{ lib, config, ... }: { +{ lib, config, pkgs, ... }: { #environment.sessionVariables.SOPS_AGE_KEY_FILE = keyFilePath; - systemd.user.startServices = "sd-switch"; + systemd.user.startServices = lib.mkIf pkgs.stdenv.isLinux "sd-switch"; programs.home-manager.enable = true; home = { username = "${config.usercfg.username}"; - homeDirectory = "/home/${config.usercfg.username}"; + homeDirectory = + if pkgs.stdenv.isDarwin then + "/Users/${config.usercfg.username}" + else + "/home/${config.usercfg.username}"; stateVersion = "26.05"; }; diff --git a/modules/server/containers/apps/miniflux.nix b/modules/server/containers/apps/miniflux.nix index e69de29..b13abff 100644 --- a/modules/server/containers/apps/miniflux.nix +++ b/modules/server/containers/apps/miniflux.nix @@ -0,0 +1,2 @@ +{ name, ... }: +throw "Container app `${name}` is not implemented yet." diff --git a/modules/server/containers/apps/trmnl.nix b/modules/server/containers/apps/trmnl.nix index 6d83f94..b13abff 100644 --- a/modules/server/containers/apps/trmnl.nix +++ b/modules/server/containers/apps/trmnl.nix @@ -1,3 +1,2 @@ -{...}:{ - -} \ No newline at end of file +{ name, ... }: +throw "Container app `${name}` is not implemented yet." diff --git a/modules/server/containers/builder.nix b/modules/server/containers/builder.nix index 985fdac..66a58e1 100644 --- a/modules/server/containers/builder.nix +++ b/modules/server/containers/builder.nix @@ -61,7 +61,7 @@ let }; in lib.recursiveUpdate base overrides; vmBuilder = { name, vm }: ((import "${pkgs.path}/nixos/lib/eval-config.nix" { - system = "x86_64-linux"; + system = pkgs.stdenv.hostPlatform.system; modules = [ vm.cfg ({ config, lib, modulesPath, ... }: { imports = [ diff --git a/modules/server/containers/default.nix b/modules/server/containers/default.nix index 1a582d4..a5fcc87 100644 --- a/modules/server/containers/default.nix +++ b/modules/server/containers/default.nix @@ -16,7 +16,9 @@ let basePathConfigs = lib.mapAttrsToList (_: cfg: cfg) (lib.filterAttrs (name: _: name != "config" && name != "data") serverCfg.path); runtimePathConfigs = concatRuntimeLists "paths"; - allSetupConfigs = map (app: ({ name = app.name; envFile = ""; } // app.runtime.setup)) appsList; + allSetupConfigs = builtins.filter + (setup: setup.script != null) + (map (app: ({ name = app.name; envFile = [ ]; } // app.runtime.setup)) appsList); allCronsConfigs = concatRuntimeLists "cron"; allVMConfigs = builtins.filter (app: app.runtime.vm != null) appsList; mkPathSetup = cfg: diff --git a/modules/shared/sops/default.nix b/modules/shared/sops/default.nix index c0e96e0..4c2e650 100755 --- a/modules/shared/sops/default.nix +++ b/modules/shared/sops/default.nix @@ -1,6 +1,8 @@ { config, lib, pkgs, ... }: let isCI = builtins.elem config.syscfg.hostname [ "ci" "sandbox" ]; + defaultUser = config.users.users.${config.syscfg.defaultUser} or { }; + defaultGroup = if pkgs.stdenv.isDarwin then "staff" else "users"; keyFilePath = (if isCI then "/var/lib/sops-nix/mock-key.txt" else @@ -8,7 +10,7 @@ let sopsFilePath = (if isCI then ./mock.yaml else ./common.yaml); in { environment.systemPackages = with pkgs; [ sops ]; - environment.sessionVariables.SOPS_AGE_KEY_FILE = keyFilePath; + environment.variables.SOPS_AGE_KEY_FILE = keyFilePath; sops.defaultSopsFile = sopsFilePath; sops.age.keyFile = keyFilePath; @@ -19,8 +21,8 @@ in { { "${config.syscfg.hostname}_ssh_priv" = { mode = "0400"; - owner = config.users.users.${config.syscfg.defaultUser}.name; - group = config.users.users.${config.syscfg.defaultUser}.group; + owner = defaultUser.name or config.syscfg.defaultUser; + group = defaultUser.group or defaultGroup; }; } (lib.mkIf config.syscfg.net.wlp.enable { diff --git a/modules/shared/syscfg/extra.nix b/modules/shared/syscfg/extra.nix index 9e70b2d..484bf26 100644 --- a/modules/shared/syscfg/extra.nix +++ b/modules/shared/syscfg/extra.nix @@ -6,6 +6,6 @@ with lib; { domain = mkOption { type = types.str; default = ""; }; port = mkOption { type = types.str; default = ""; }; noProxy = mkOption { type = types.str; default = ""; }; - cert = mkOption { type = types.path; default = null; }; + cert = mkOption { type = types.nullOr types.path; default = null; }; }; -} \ No newline at end of file +} diff --git a/packages/default.nix b/packages/default.nix index 5f71d85..dc805f7 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,15 +1,8 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ amdgpu_top = pkgs.callPackage ./amdgpu_top { }; simc = pkgs.qt6.callPackage ./simc { }; repalette = pkgs.callPackage ./repalette { }; vosk = pkgs.callPackage ./vosk { }; - - pythonPackages = { - - }; - - nodePackages = { - - }; } diff --git a/systems/asgard/default.nix b/systems/asgard/default.nix index eb7983e..86c04e9 100755 --- a/systems/asgard/default.nix +++ b/systems/asgard/default.nix @@ -12,8 +12,7 @@ }; fonts = { - fontDir.enable = true; - fonts = with pkgs; [ ibm-plex openmoji-color material-design-icons ]; + packages = with pkgs; [ ibm-plex openmoji-color material-design-icons ]; }; environment = { @@ -33,8 +32,6 @@ programs = { zsh.enable = true; }; - services = { nix-daemon.enable = true; }; - homebrew = { enable = true; onActivation = { @@ -54,7 +51,11 @@ ''; gc = { automatic = true; - dates = "weekly"; + interval = { + Weekday = 0; + Hour = 3; + Minute = 0; + }; options = "--delete-older-than 7d"; }; settings = { @@ -67,6 +68,7 @@ }; system = { + primaryUser = "sora"; defaults = { NSGlobalDomain = { KeyRepeat = 1;