mirror of
https://codeberg.org/privacy1st/nixos-anywhere-example
synced 2024-11-22 22:09:34 +01:00
feat: move flake into template
This commit is contained in:
parent
c20b0628b9
commit
fc302ca3b5
38
README.md
38
README.md
@ -1,37 +1 @@
|
||||
# disko + nixos-anywhere workshop
|
||||
|
||||
This is an example repo for nixos-anywhere and disko.
|
||||
It's part of our CCC camp workshop.
|
||||
|
||||
To run the interactive vm test run:
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
|
||||
```
|
||||
|
||||
You can also install the vm on some remote system when running
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
|
||||
```
|
||||
|
||||
|
||||
Improve this workshop README:
|
||||
|
||||
# disko + nixos-anywhere workshop
|
||||
|
||||
This is an example repo for nixos-anywhere and disko.
|
||||
It's part of our CCC camp workshop.
|
||||
|
||||
To run the interactive vm test run:
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
|
||||
```
|
||||
|
||||
You can also install the vm on some remote system when running
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
|
||||
```
|
||||
|
||||
# nixos-anywhere-workshop template
|
40
flake.nix
40
flake.nix
@ -1,40 +1,8 @@
|
||||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
inputs.disko.url = "github:nix-community/disko";
|
||||
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere";
|
||||
inputs.nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
outputs = { self, nixpkgs, disko, nixos-anywhere, ... }@attrs: {
|
||||
packages."x86_64-linux".makeDiskImageTest = disko.lib.lib.makeDiskImage {
|
||||
nixosConfig = self.nixosConfigurations.mysystem;
|
||||
};
|
||||
packages."x86_64-linux".makeDiskScriptTest = disko.lib.lib.makeDiskImageScript {
|
||||
nixosConfig = self.nixosConfigurations.mysystem;
|
||||
};
|
||||
nixosConfigurations.mysystem = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = attrs;
|
||||
modules = [
|
||||
(nixpkgs.outPath + "/nixos/modules/installer/scan/not-detected.nix")
|
||||
disko.nixosModules.disko
|
||||
./disk-configs/simple-efi.nix # choose your favorite disk layout here
|
||||
#./disk-configs/zfs.nix # choose your favorite disk layout here
|
||||
#./disk-configs/luks-lvm.nix # choose your favorite disk layout here
|
||||
{
|
||||
boot.loader.grub = {
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
};
|
||||
boot.swraid.enable = true;
|
||||
# Alternative to grub
|
||||
#boot.loader.systemd-boot.enable = true;
|
||||
# when installing toggle this
|
||||
#boot.loader.efi.canTouchEfiVariables = false;
|
||||
}
|
||||
];
|
||||
outputs = {...}: {
|
||||
templates.default = {
|
||||
description = "A nixos-anywhere example";
|
||||
path = ./template;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
37
template/README.md
Normal file
37
template/README.md
Normal file
@ -0,0 +1,37 @@
|
||||
# disko + nixos-anywhere workshop
|
||||
|
||||
This is an example repo for nixos-anywhere and disko.
|
||||
It's part of our CCC camp workshop.
|
||||
|
||||
To run the interactive vm test run:
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
|
||||
```
|
||||
|
||||
You can also install the vm on some remote system when running
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
|
||||
```
|
||||
|
||||
|
||||
Improve this workshop README:
|
||||
|
||||
# disko + nixos-anywhere workshop
|
||||
|
||||
This is an example repo for nixos-anywhere and disko.
|
||||
It's part of our CCC camp workshop.
|
||||
|
||||
To run the interactive vm test run:
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
|
||||
```
|
||||
|
||||
You can also install the vm on some remote system when running
|
||||
|
||||
```
|
||||
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
|
||||
```
|
||||
|
40
template/flake.nix
Normal file
40
template/flake.nix
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
inputs.disko.url = "github:nix-community/disko";
|
||||
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere";
|
||||
inputs.nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
outputs = { self, nixpkgs, disko, nixos-anywhere, ... }@attrs: {
|
||||
packages."x86_64-linux".makeDiskImageTest = disko.lib.lib.makeDiskImage {
|
||||
nixosConfig = self.nixosConfigurations.mysystem;
|
||||
};
|
||||
packages."x86_64-linux".makeDiskScriptTest = disko.lib.lib.makeDiskImageScript {
|
||||
nixosConfig = self.nixosConfigurations.mysystem;
|
||||
};
|
||||
nixosConfigurations.mysystem = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = attrs;
|
||||
modules = [
|
||||
(nixpkgs.outPath + "/nixos/modules/installer/scan/not-detected.nix")
|
||||
disko.nixosModules.disko
|
||||
./disk-configs/simple-efi.nix # choose your favorite disk layout here
|
||||
#./disk-configs/zfs.nix # choose your favorite disk layout here
|
||||
#./disk-configs/luks-lvm.nix # choose your favorite disk layout here
|
||||
{
|
||||
boot.loader.grub = {
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
};
|
||||
boot.swraid.enable = true;
|
||||
# Alternative to grub
|
||||
#boot.loader.systemd-boot.enable = true;
|
||||
# when installing toggle this
|
||||
#boot.loader.efi.canTouchEfiVariables = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user