-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from feel-co/no-extra-special-args
modules: rename `hjem.extraSpecialArgs` to `hjem.specialArgs`
- Loading branch information
Showing
8 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
let | ||
userHome = "/home/alice"; | ||
in | ||
(import ./lib.nix) { | ||
(import ./lib) { | ||
name = "hjem-basic"; | ||
nodes = { | ||
node1 = { | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
let | ||
userHome = "/home/alice"; | ||
in | ||
(import ./lib) { | ||
name = "hjem-basic"; | ||
nodes = { | ||
node1 = {self, ...}: { | ||
imports = [self.nixosModules.hjem]; | ||
|
||
users.groups.alice = {}; | ||
users.users.alice = { | ||
isNormalUser = true; | ||
home = userHome; | ||
password = ""; | ||
}; | ||
|
||
hjem = { | ||
# Things like username, home directory or credentials should not really | ||
# be put into specialArgs, but users do it anyway. Lets test for a very | ||
# basic case of 'username' being passed to specialArgs as a string and | ||
# is consumed in a file later on. | ||
specialArgs = {username = "alice";}; | ||
users.alice = { | ||
pkgs, | ||
username, | ||
... | ||
}: { | ||
enable = true; | ||
packages = [pkgs.hello]; | ||
files.".config/fooconfig" = { | ||
text = "My username is ${username}"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
testScript = '' | ||
machine.succeed("loginctl enable-linger alice") | ||
machine.wait_until_succeeds("systemctl --user --machine=alice@ is-active systemd-tmpfiles-setup.service") | ||
# Test if the config file is properly generated, and contains the desired string1 | ||
machine.succeed("grep alice ~alice/.config/fooconfig") | ||
''; | ||
} |