mirror of
https://github.com/nix-community/srvos.git
synced 2024-08-17 01:40:26 +03:00
Merge pull request #323 from R-VdP/rvdp/remove_nixpkgs_config
Don't set nixpkgs.config, it breaks some setups.
This commit is contained in:
commit
3d589b3573
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
result
|
||||
.direnv
|
||||
|
@ -1,12 +1,7 @@
|
||||
{ prefix, srvos, nixpkgs, system }:
|
||||
{ prefix, srvos, pkgs, lib, system }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
nixosTest = import "${pkgs.path}/nixos/lib/testing-python.nix" {
|
||||
inherit pkgs;
|
||||
system = pkgs.system;
|
||||
inherit pkgs system;
|
||||
};
|
||||
|
||||
moduleTests = {
|
||||
@ -25,7 +20,7 @@ let
|
||||
};
|
||||
|
||||
configurations = import ./test-configurations.nix {
|
||||
inherit srvos nixpkgs system;
|
||||
inherit srvos pkgs lib system;
|
||||
};
|
||||
|
||||
# Add all the nixos configurations to the checks
|
||||
|
@ -1,9 +1,8 @@
|
||||
# We use the nixosConfigurations to test all the modules below.
|
||||
#
|
||||
# This is not optimal, but it gets the job done
|
||||
{ srvos, nixpkgs, system }:
|
||||
{ srvos, pkgs, lib, system }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (lib) nixosSystem;
|
||||
|
||||
# some example configuration to make it eval
|
||||
@ -13,6 +12,10 @@ let
|
||||
users.users.root.initialPassword = "fnord23";
|
||||
boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
|
||||
fileSystems."/".device = lib.mkDefault "/dev/sda";
|
||||
|
||||
# Don't reinstantiate nixpkgs for every nixos eval.
|
||||
# Also important to have nixpkgs config which allows for some required insecure packages
|
||||
nixpkgs = { inherit pkgs; };
|
||||
};
|
||||
in
|
||||
{
|
||||
|
22
flake.nix
22
flake.nix
@ -9,10 +9,20 @@
|
||||
let
|
||||
srvos = self;
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
permittedInsecurePackages = [
|
||||
"nodejs-16.20.0"
|
||||
"nodejs-16.20.1"
|
||||
"nodejs-16.20.2"
|
||||
];
|
||||
|
||||
eachSystem = f:
|
||||
lib.genAttrs
|
||||
srvos.lib.supportedSystems
|
||||
(system: f nixpkgs.legacyPackages.${system});
|
||||
(system: f (import nixpkgs {
|
||||
inherit system;
|
||||
config = { inherit permittedInsecurePackages; };
|
||||
}));
|
||||
in
|
||||
{
|
||||
lib.supportedSystems = [
|
||||
@ -23,13 +33,17 @@
|
||||
];
|
||||
|
||||
checks = eachSystem (pkgs:
|
||||
{ } // (lib.optionalAttrs (pkgs.system == "x86_64-linux") (import ./dev/checks.nix {
|
||||
inherit srvos nixpkgs;
|
||||
(lib.optionalAttrs (pkgs.system == "x86_64-linux") (import ./dev/checks.nix {
|
||||
inherit srvos pkgs lib;
|
||||
prefix = "nixos";
|
||||
system = pkgs.system;
|
||||
})) // (lib.optionalAttrs (pkgs.system == "x86_64-linux") (import ./dev/checks.nix {
|
||||
inherit srvos;
|
||||
nixpkgs = nixos-23_05;
|
||||
pkgs = import nixos-23_05 {
|
||||
inherit (pkgs) system;
|
||||
config = { inherit permittedInsecurePackages; };
|
||||
};
|
||||
inherit (nixos-23_05) lib;
|
||||
prefix = "nixos-23_05";
|
||||
system = pkgs.system;
|
||||
})));
|
||||
|
@ -57,12 +57,6 @@ in
|
||||
})
|
||||
cfg);
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"nodejs-16.20.0"
|
||||
"nodejs-16.20.1"
|
||||
"nodejs-16.20.2"
|
||||
];
|
||||
|
||||
systemd.services = flip mapAttrs' cfg (n: v:
|
||||
let
|
||||
svcName = "github-runner-${n}";
|
||||
|
Loading…
Reference in New Issue
Block a user