Skip to content

Commit

Permalink
Add configuration specialArgs example
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Mar 27, 2024
1 parent 3d829c7 commit 5257be6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
7 changes: 5 additions & 2 deletions example/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{ lib, pkgs, config, ... }: {
{ lib, pkgs, config, unstable, ... }: {

imports = [ ./hardware-configuration.nix ];
imports = [
./hardware-configuration.nix
(unstable + "/nixos/modules/services/video/photonvision.nix")
];

boot.loader.timeout = 10;
boot.loader.grub.device = "/dev/vda";
Expand Down
63 changes: 38 additions & 25 deletions example/deploy.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
{ config, ... }: {
{ config, lib, ... }: {

options.defaults = lib.mkOption {
type = lib.types.submodule {
options.configuration = lib.mkOption {
type = lib.types.submoduleWith {
specialArgs.unstable = fetchTarball "channel:nixpkgs-unstable";
modules = [];
};
};
};
};

defaults = { lib, name, ... }: {
configuration = {
networking.hostName = lib.mkDefault name;
config = {
defaults = { lib, name, ... }: {
configuration = {
networking.hostName = lib.mkDefault name;
};

# Which nixpkgs version we want to use for this node
nixpkgs = lib.mkDefault (fetchTarball {
url = "https://github.com/NixOS/nixpkgs/tarball/81cef6b70fb5d5cdba5a0fef3f714c2dadaf0d6d";
sha256 = "1mj9psy1hfy3fbalwkdlyw3jmc97sl9g3xj1xh8dmhl68g0pfjin";
});
};

# Which nixpkgs version we want to use for this node
nixpkgs = lib.mkDefault (fetchTarball {
url = "https://github.com/NixOS/nixpkgs/tarball/81cef6b70fb5d5cdba5a0fef3f714c2dadaf0d6d";
sha256 = "1mj9psy1hfy3fbalwkdlyw3jmc97sl9g3xj1xh8dmhl68g0pfjin";
});
};
nodes.foo = { lib, config, ... }: {
# How to reach this node
host = "[email protected]";

nodes.foo = { lib, config, ... }: {
# How to reach this node
host = "[email protected]";
# What configuration it should have
configuration = ./configuration.nix;
};

# What configuration it should have
configuration = ./configuration.nix;
};
nodes.legacyNixpkgs = { lib, config, ... }: {
# How to reach this node
host = "[email protected]";

nodes.legacyNixpkgs = { lib, config, ... }: {
# How to reach this node
host = "[email protected]";
nixpkgs = fetchTarball {
url = "https://github.com/NixOS/nixpkgs/tarball/38431cf21c59a84c0ddedccc0cd66540a550ec26";
sha256 = "0bi5lkq2a34pij00axsa0l0j43y8688mf41p51b6zyfdzgjgsc42";
};

nixpkgs = fetchTarball {
url = "https://github.com/NixOS/nixpkgs/tarball/38431cf21c59a84c0ddedccc0cd66540a550ec26";
sha256 = "0bi5lkq2a34pij00axsa0l0j43y8688mf41p51b6zyfdzgjgsc42";
# What configuration it should have
configuration = ./configuration.nix;
};

# What configuration it should have
configuration = ./configuration.nix;
};

}

0 comments on commit 5257be6

Please sign in to comment.