feat: nix settings
This commit is contained in:
parent
2c4c938b1f
commit
b30f617f44
8 changed files with 79 additions and 92 deletions
|
@ -3,6 +3,7 @@
|
|||
../options
|
||||
|
||||
#
|
||||
./nix.nix
|
||||
|
||||
../home
|
||||
];
|
||||
|
|
62
modules/base/nix.nix
Normal file
62
modules/base/nix.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
nix = {
|
||||
package = pkgs.lix;
|
||||
|
||||
# Pin system <nixpkgs> to flake nixpkgs version.
|
||||
# i.e. for use in pkgs = import <nixpkgs> {}.
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
|
||||
# Pin flake registry nixpkgs to flake nixpkgs version.
|
||||
# i.e. for use in nix search nixpkgs.
|
||||
registry = {
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
};
|
||||
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
trusted-users = [
|
||||
"root"
|
||||
# @wheel/@admin are added in OS specific modules.
|
||||
];
|
||||
|
||||
# Set up caches.
|
||||
extra-substituters = [
|
||||
"https://marleyos.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
|
||||
# Disable that annoying "git tree is dirty" warning.
|
||||
warn-dirty = false;
|
||||
|
||||
auto-optimise-store = true;
|
||||
|
||||
use-xdg-base-directories = true;
|
||||
};
|
||||
|
||||
# Garbage collection.
|
||||
gc.automatic = true;
|
||||
|
||||
# More useful repl.
|
||||
environment.systemPackages = let
|
||||
nrepl =
|
||||
pkgs.writeShellScriptBin "nrepl"
|
||||
# sh
|
||||
''
|
||||
nix repl "${toString ./.}/repl.nix" "$@"
|
||||
'';
|
||||
in [
|
||||
nrepl
|
||||
];
|
||||
};
|
||||
}
|
5
modules/darwin/base/default.nix
Normal file
5
modules/darwin/base/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./nix.nix
|
||||
];
|
||||
}
|
9
modules/darwin/base/nix.nix
Normal file
9
modules/darwin/base/nix.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
nix = {
|
||||
settings = {
|
||||
trusted-users = [
|
||||
"@darwin"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
../base
|
||||
./base
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
nix = {
|
||||
package = pkgs.lix;
|
||||
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
trusted-users = [
|
||||
"root"
|
||||
"@wheel"
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config.nix = {
|
||||
package = pkgs.lix;
|
||||
};
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
config = {
|
||||
nix = {
|
||||
package = lib.mkForce pkgs.lix;
|
||||
|
||||
# Pin system <nixpkgs> to flake nixpkgs version.
|
||||
# i.e. for use in pkgs = import <nixpkgs> {}.
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
|
||||
# Pin flake registry nixpkgs to flake nixpkgs version.
|
||||
# i.e. for use in nix search nixpkgs.
|
||||
registry = {
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
};
|
||||
|
||||
settings = {
|
||||
trusted-users = [
|
||||
"root"
|
||||
"@wheel"
|
||||
];
|
||||
|
||||
# Enable flakes.
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
# Set up caches.
|
||||
extra-substituters = [
|
||||
"https://marleyos.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
|
||||
# Disable that annoying "git tree is dirty" warning.
|
||||
warn-dirty = false;
|
||||
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
|
||||
# Garbage collection.
|
||||
gc.automatic = true;
|
||||
};
|
||||
|
||||
nixpkgs.config.import = "${config.xdg.configHome}/nixpkgs/config.nix";
|
||||
|
||||
xdg.configFile."nixpkgs/config.nix".text =
|
||||
# nix
|
||||
''
|
||||
{
|
||||
allowUnfree = true;
|
||||
}
|
||||
'';
|
||||
|
||||
home.packages = let
|
||||
nrepl =
|
||||
pkgs.writeShellScriptBin "nrepl"
|
||||
# sh
|
||||
''
|
||||
nix repl "${toString ./.}/repl.nix" "$@"
|
||||
'';
|
||||
in [
|
||||
nrepl
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue