Skip to content

Commit

Permalink
fix(nix): Consolidate nix config
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Jan 7, 2025
1 parent 61e5964 commit 9012d73
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"mrjones2014-dotfiles.cachix.org-1:c66wfzthG6KZEWnltlzW/EjhlH9FwUVi5jM4rVD1Rw4="
];
experimental-features = "nix-command flakes";
trusted-users = [ "mat" ];
# these two are for optimized nix-direnv setups
keep-outputs = true;
keep-derivations = true;
};

outputs = inputs@{ self, nixpkgs, home-manager, agenix, flake-utils, ... }:
{
nixosConfigurations = {
Expand Down
6 changes: 3 additions & 3 deletions home-manager/modules/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@
${if isDarwin then
"home-manager switch --flake ~/git/dotfiles/.#mac"
else if isServer then
"sudo nixos-rebuild switch --flake ~/git/dotfiles/.#server --accept-nix-config"
"sudo nixos-rebuild switch --flake ~/git/dotfiles/.#server --accept-flake-config"
else if isThinkpad then
"sudo nixos-rebuild switch --flake ~/git/dotfiles/.#laptop --accept-nix-config"
"sudo nixos-rebuild switch --flake ~/git/dotfiles/.#laptop --accept-flake-config"
else
"sudo nixos-rebuild switch --flake ~/git/dotfiles/.#pc --accept-nix-config"}
"sudo nixos-rebuild switch --flake ~/git/dotfiles/.#pc --accept-flake-config"}
'';
};
nix-clean = {
Expand Down
10 changes: 1 addition & 9 deletions home-manager/shared.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{ pkgs, lib, ... }: {
nix = {
package = lib.mkDefault pkgs.lix;
extraOptions = ''
keep-outputs = true
keep-derivations = true
auto-optimise-store = true
experimental-features = nix-command flakes
'';
};
nix.package = lib.mkDefault pkgs.lix;
theme = "tokyonight";
imports = [
../nixos-modules/theme.nix
Expand Down
10 changes: 3 additions & 7 deletions nixos-modules/common.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{ pkgs, lib, ... }: {
nix = {
package = lib.mkDefault pkgs.lix;
settings.trusted-users = [ "mat" ];
extraOptions = ''
keep-outputs = true
keep-derivations = true
auto-optimise-store = true
experimental-features = nix-command flakes
'';
# setting this here because it causes issues on Darwin;
# https://github.com/NixOS/nix/issues/7273
settings.auto-optimise-store = true;
};

environment.systemPackages = [ pkgs.mullvad-vpn ];
Expand Down

0 comments on commit 9012d73

Please sign in to comment.