nixpkgs: switch to read-only packages
Signed-off-by: Bloxx12 <charlie@charlieroot.dev> Change-Id: I6a6a69641b8369b151024324d8d06f2acb790c15
This commit is contained in:
parent
d276dea712
commit
3a9e31cc88
2 changed files with 60 additions and 48 deletions
|
@ -1,5 +1,5 @@
|
||||||
let
|
let
|
||||||
inherit (builtins) currentSystem filter mapAttrs;
|
inherit (builtins) filter mapAttrs;
|
||||||
|
|
||||||
# https://github.com/andir/npins?tab=readme-ov-file#using-the-nixpkgs-fetchers
|
# https://github.com/andir/npins?tab=readme-ov-file#using-the-nixpkgs-fetchers
|
||||||
src = import ./npins;
|
src = import ./npins;
|
||||||
|
@ -20,10 +20,7 @@ let
|
||||||
modules = [
|
modules = [
|
||||||
# This is used to pre-emptively set the hostPlatform for nixpkgs.
|
# This is used to pre-emptively set the hostPlatform for nixpkgs.
|
||||||
# Also, we set the system hostname here.
|
# Also, we set the system hostname here.
|
||||||
{
|
{ networking.hostName = hostname; }
|
||||||
networking.hostName = hostname;
|
|
||||||
nixpkgs.hostPlatform = system;
|
|
||||||
}
|
|
||||||
./hosts/common.nix
|
./hosts/common.nix
|
||||||
./hosts/${hostname}
|
./hosts/${hostname}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,18 +1,32 @@
|
||||||
# taken from raf
|
|
||||||
{ sources, ... }:
|
|
||||||
{
|
{
|
||||||
# Global nixpkgs configuration.
|
lib,
|
||||||
# This is ignored if nixpkgs.pkgs is set, which should be avoided.
|
sources,
|
||||||
nixpkgs = {
|
pkgs,
|
||||||
flake = {
|
...
|
||||||
source = sources.nixpkgs;
|
}:
|
||||||
setFlakeRegistry = true;
|
let
|
||||||
setNixPath = true;
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) str;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Going full schizo
|
||||||
|
"${sources.nixpkgs}/nixos/modules/misc/nixpkgs/read-only.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
options.nixpkgs.system = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = pkgs.system;
|
||||||
|
readOnly = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.nixpkgs.pkgs = (
|
||||||
|
import sources.nixpkgs {
|
||||||
|
hostPlatform = pkgs.stdenv.hostPlatform;
|
||||||
|
overlays = [ ];
|
||||||
|
config = {
|
||||||
# Configuration reference:
|
# Configuration reference:
|
||||||
# <https://nixos.org/manual/nixpkgs/unstable/#chap-packageconfig>
|
# <https://nixos.org/manual/nixpkgs/unstable/#chap-packageconfig>
|
||||||
config = {
|
|
||||||
# Disallow broken packages to be built.
|
# Disallow broken packages to be built.
|
||||||
allowBroken = false;
|
allowBroken = false;
|
||||||
|
|
||||||
|
@ -43,5 +57,6 @@
|
||||||
# See: <https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/check-meta.nix>
|
# See: <https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/check-meta.nix>
|
||||||
showDerivationWarnings = [ ];
|
showDerivationWarnings = [ ];
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue