Skip to content

Commit

Permalink
feat: Nix settings tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lpchaim committed Nov 23, 2024
1 parent f62714f commit f835d25
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 35 deletions.
3 changes: 1 addition & 2 deletions lib/shared/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ in {
wallpaper = assetWithPrefix "wallpaper";
profilePicture = assetWithPrefix "profile-picture";
};
nix.settings = rec {
nix.settings = {
accept-flake-config = true;
builders-use-substitutes = true;
auto-optimise-store = true;
extra-experimental-features = "flakes nix-command";
extra-substituters = extra-trusted-substituters;
extra-trusted-substituters = [
"https://hyprland.cachix.org"
"https://lpchaim.cachix.org"
Expand Down
62 changes: 32 additions & 30 deletions modules/home/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,38 @@
config,
lib,
...
} @ args:
with lib; let
} @ args: let
inherit (lib) mkDefault;
inherit (lib.lpchaim) shared;
inherit (lib.snowfall) fs;
namespace = ["my" "modules"];
cfg = getAttrFromPath namespace config;
in {
imports = [
(fs.get-file "modules/shared")
];

options = setAttrByPath namespace {
enable = mkEnableOption "customizations";
};

config = {
my.modules = {
enable = mkDefault true;
cli.enable = mkDefault true;
de.gnome.enable = mkDefault false;
gui.enable = mkDefault false;
in
lib.lpchaim.mkModule {
inherit config;
description = "root home config";
namespace = "my.modules";
imports = [
(fs.get-file "modules/shared")
];
configBuilder = cfg: {
my.modules = {
enable = mkDefault true;
cli.enable = mkDefault true;
de.gnome.enable = mkDefault false;
gui.enable = mkDefault false;
};
programs.home-manager.enable = mkDefault true;
nix =
{
gc = {
automatic = true;
frequency = "daily";
options = "--delete-older-than=7d";
};
settings = shared.nix.settings;
}
// (lib.optionalAttrs (args ? osConfig) {
inherit (args.osConfig.nix) extraOptions;
});
systemd.user.startServices = "sd-switch";
};
programs.home-manager.enable = mkDefault true;
nix.gc = {
automatic = true;
frequency = "daily";
options = "--delete-older-than=7d";
};
nix.settings = shared.nix.settings;
nix.extraOptions = mkIf (args ? osConfig) args.osConfig.nix.extraOptions;
systemd.user.startServices = "sd-switch";
};
}
}
2 changes: 1 addition & 1 deletion modules/nixos/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ in {

# Package manager
nix = {
package = pkgs.nixFlakes;
package = pkgs.nixVersions.stable;
extraOptions = ''
experimental-features = flakes nix-command
'';
Expand Down
13 changes: 11 additions & 2 deletions modules/nixos/secrets/extraNixOptions/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{config, ...}: {
sops.secrets."nix/extraAccessTokens".mode = "0440";
{
config,
lib,
...
}: let
inherit (lib.lpchaim.shared) defaults;
in {
sops.secrets."nix/extraAccessTokens" = {
mode = "0400";
owner = defaults.name.user;
};
nix.extraOptions = ''
!include ${config.sops.secrets."nix/extraAccessTokens".path}
'';
Expand Down

0 comments on commit f835d25

Please sign in to comment.