mirror of
https://github.com/nix-community/srvos.git
synced 2024-09-11 14:17:02 +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
|
result
|
||||||
|
.direnv
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
{ prefix, srvos, nixpkgs, system }:
|
{ prefix, srvos, pkgs, lib, system }:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
|
|
||||||
inherit (nixpkgs) lib;
|
|
||||||
|
|
||||||
nixosTest = import "${pkgs.path}/nixos/lib/testing-python.nix" {
|
nixosTest = import "${pkgs.path}/nixos/lib/testing-python.nix" {
|
||||||
inherit pkgs;
|
inherit pkgs system;
|
||||||
system = pkgs.system;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
moduleTests = {
|
moduleTests = {
|
||||||
@ -25,7 +20,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
configurations = import ./test-configurations.nix {
|
configurations = import ./test-configurations.nix {
|
||||||
inherit srvos nixpkgs system;
|
inherit srvos pkgs lib system;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Add all the nixos configurations to the checks
|
# Add all the nixos configurations to the checks
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
# We use the nixosConfigurations to test all the modules below.
|
# We use the nixosConfigurations to test all the modules below.
|
||||||
#
|
#
|
||||||
# This is not optimal, but it gets the job done
|
# This is not optimal, but it gets the job done
|
||||||
{ srvos, nixpkgs, system }:
|
{ srvos, pkgs, lib, system }:
|
||||||
let
|
let
|
||||||
inherit (nixpkgs) lib;
|
|
||||||
inherit (lib) nixosSystem;
|
inherit (lib) nixosSystem;
|
||||||
|
|
||||||
# some example configuration to make it eval
|
# some example configuration to make it eval
|
||||||
@ -13,6 +12,10 @@ let
|
|||||||
users.users.root.initialPassword = "fnord23";
|
users.users.root.initialPassword = "fnord23";
|
||||||
boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
|
boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
|
||||||
fileSystems."/".device = lib.mkDefault "/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
|
in
|
||||||
{
|
{
|
||||||
|
22
flake.nix
22
flake.nix
@ -9,10 +9,20 @@
|
|||||||
let
|
let
|
||||||
srvos = self;
|
srvos = self;
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
|
permittedInsecurePackages = [
|
||||||
|
"nodejs-16.20.0"
|
||||||
|
"nodejs-16.20.1"
|
||||||
|
"nodejs-16.20.2"
|
||||||
|
];
|
||||||
|
|
||||||
eachSystem = f:
|
eachSystem = f:
|
||||||
lib.genAttrs
|
lib.genAttrs
|
||||||
srvos.lib.supportedSystems
|
srvos.lib.supportedSystems
|
||||||
(system: f nixpkgs.legacyPackages.${system});
|
(system: f (import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config = { inherit permittedInsecurePackages; };
|
||||||
|
}));
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib.supportedSystems = [
|
lib.supportedSystems = [
|
||||||
@ -23,13 +33,17 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
checks = eachSystem (pkgs:
|
checks = eachSystem (pkgs:
|
||||||
{ } // (lib.optionalAttrs (pkgs.system == "x86_64-linux") (import ./dev/checks.nix {
|
(lib.optionalAttrs (pkgs.system == "x86_64-linux") (import ./dev/checks.nix {
|
||||||
inherit srvos nixpkgs;
|
inherit srvos pkgs lib;
|
||||||
prefix = "nixos";
|
prefix = "nixos";
|
||||||
system = pkgs.system;
|
system = pkgs.system;
|
||||||
})) // (lib.optionalAttrs (pkgs.system == "x86_64-linux") (import ./dev/checks.nix {
|
})) // (lib.optionalAttrs (pkgs.system == "x86_64-linux") (import ./dev/checks.nix {
|
||||||
inherit srvos;
|
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";
|
prefix = "nixos-23_05";
|
||||||
system = pkgs.system;
|
system = pkgs.system;
|
||||||
})));
|
})));
|
||||||
|
@ -57,12 +57,6 @@ in
|
|||||||
})
|
})
|
||||||
cfg);
|
cfg);
|
||||||
|
|
||||||
nixpkgs.config.permittedInsecurePackages = [
|
|
||||||
"nodejs-16.20.0"
|
|
||||||
"nodejs-16.20.1"
|
|
||||||
"nodejs-16.20.2"
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services = flip mapAttrs' cfg (n: v:
|
systemd.services = flip mapAttrs' cfg (n: v:
|
||||||
let
|
let
|
||||||
svcName = "github-runner-${n}";
|
svcName = "github-runner-${n}";
|
||||||
|
Loading…
Reference in New Issue
Block a user