Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nixos-machines-template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Legy (Beini)
nixos-machines-template
Commits
e73493c7
Verified
Commit
e73493c7
authored
3 years ago
by
Legy (Beini)
Browse files
Options
Downloads
Patches
Plain Diff
Add some example modules
parent
762328da
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
flake.nix
+4
-1
4 additions, 1 deletion
flake.nix
machines/foobar/default.nix
+8
-1
8 additions, 1 deletion
machines/foobar/default.nix
modules/complexExample.nix
+14
-0
14 additions, 0 deletions
modules/complexExample.nix
modules/simpleExample.nix
+11
-0
11 additions, 0 deletions
modules/simpleExample.nix
with
37 additions
and
2 deletions
flake.nix
+
4
−
1
View file @
e73493c7
...
@@ -11,9 +11,12 @@
...
@@ -11,9 +11,12 @@
};
};
outputs
=
flakes
:
flakes
.
wat
.
lib
.
mkWatRepo
flakes
({
findMachines
,
...
}:
{
outputs
=
flakes
:
flakes
.
wat
.
lib
.
mkWatRepo
flakes
({
findModules
,
findMachines
,
...
}:
rec
{
loadModules
=
outputs
.
nixosModules
;
outputs
=
{
outputs
=
{
nixosModules
=
findModules
[
"example"
]
./modules
;
nixosConfigurations
=
findMachines
./machines
;
nixosConfigurations
=
findMachines
./machines
;
};
};
...
...
This diff is collapsed.
Click to expand it.
machines/foobar/default.nix
+
8
−
1
View file @
e73493c7
{
mkMachine
,
flakes
,
...
}:
{
mkMachine
,
flakes
,
...
}:
mkMachine
flakes
.
nixpkgs
"x86_64-linux"
({
...
}:
{
mkMachine
flakes
.
nixpkgs
"x86_64-linux"
({
pkgs
,
...
}:
{
# your system here
# your system here
fileSystems
.
"/"
=
{
fileSystems
.
"/"
=
{
...
@@ -8,4 +8,11 @@ mkMachine flakes.nixpkgs "x86_64-linux" ({ ... }: {
...
@@ -8,4 +8,11 @@ mkMachine flakes.nixpkgs "x86_64-linux" ({ ... }: {
};
};
boot
.
loader
.
grub
.
device
=
"/dev/TODO"
;
boot
.
loader
.
grub
.
device
=
"/dev/TODO"
;
#enable some example modules
wat
.
example
.
simpleExample
.
enable
=
true
;
wat
.
example
.
complexExample
=
{
enable
=
true
;
specialExtraPackages
=
with
pkgs
;
[
htop
];
};
})
})
This diff is collapsed.
Click to expand it.
modules/complexExample.nix
0 → 100644
+
14
−
0
View file @
e73493c7
{
lib
,
config
,
mkModule
,
liftToNamespace
,
...
}:
with
lib
;
mkModule
{
options
=
liftToNamespace
{
specialExtraPackages
=
mkOption
{
default
=
[];
type
=
with
types
;
listOf
package
;
};
};
config
=
cfg
:
{
environment
.
systemPackages
=
cfg
.
specialExtraPackages
;
};
}
This diff is collapsed.
Click to expand it.
modules/simpleExample.nix
0 → 100644
+
11
−
0
View file @
e73493c7
{
lib
,
pkgs
,
mkTrivialModule
,
...
}:
with
lib
;
mkTrivialModule
{
environment
.
systemPackages
=
with
pkgs
;
[
git
nixUnstable
];
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment