Compare commits
10 Commits
disko
...
811388006f
| Author | SHA1 | Date | |
|---|---|---|---|
| 811388006f | |||
| fc7e346f1e | |||
| 0da72e9513 | |||
| 749bd75992 | |||
| 54b228381d | |||
| ee62f092e5 | |||
| 6007760092 | |||
| f8fddbba14 | |||
| f824649f85 | |||
| c4fe75a1b9 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@
|
||||
result
|
||||
result-*
|
||||
|
||||
nixos-efi-vars.fd
|
||||
|
||||
14
README.md
14
README.md
@@ -1,9 +1,15 @@
|
||||
# nixos
|
||||
|
||||
My NixOS config
|
||||
## Set up virtual machine ([`disko`](https://github.com/nix-community/disko/blob/master/docs/interactive-vm.md))
|
||||
|
||||
1. Build the virtual machine
|
||||
|
||||
```
|
||||
git clone https://git.hektormisplon.xyz/hektor/nix.git
|
||||
cd nix
|
||||
sudo nix run 'github:nix-community/disko/latest#disko-install' -- --flake .#vm --disk root /dev/vda
|
||||
nix run -L '.#nixosConfigurations.vm.config.system.build.vmWithDisko'
|
||||
```
|
||||
|
||||
2. Run the virtual machine
|
||||
|
||||
```
|
||||
QEMU_KERNEL_PARAMS=console=ttyS0 ./result/bin/run-nixos-vm -nographic; reset
|
||||
```
|
||||
|
||||
6
flake.lock
generated
6
flake.lock
generated
@@ -44,11 +44,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1759439645,
|
||||
"narHash": "sha256-oiAyQaRilPk525Z5aTtTNWNzSrcdJ7IXM0/PL3CGlbI=",
|
||||
"lastModified": 1759580034,
|
||||
"narHash": "sha256-YWo57PL7mGZU7D4WeKFMiW4ex/O6ZolUS6UNBHTZfkI=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "879bd460b3d3e8571354ce172128fbcbac1ed633",
|
||||
"rev": "3bcc93c5f7a4b30335d31f21e2f1281cba68c318",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
46
flake.nix
46
flake.nix
@@ -3,28 +3,38 @@
|
||||
nixpkgs = {
|
||||
url = "github:nixos/nixpkgs?ref=nixos-25.05";
|
||||
};
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
disko = {
|
||||
url = "github:nix-community/disko/latest";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, disko, home-manager }: {
|
||||
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./hosts/vm/configuration.nix
|
||||
disko.nixosModules.disko
|
||||
home-manager.nixosModules.home-manager {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.h = ./hosts/vm/home.nix;
|
||||
}
|
||||
];
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
disko,
|
||||
home-manager,
|
||||
}:
|
||||
{
|
||||
nixosConfigurations = {
|
||||
vm = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
./hosts/vm/configuration.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.h = ./hosts/vm/home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,37 +3,35 @@
|
||||
{
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
imports =
|
||||
[
|
||||
./hard.nix
|
||||
./disk.nix
|
||||
../../modules/bootloader.nix
|
||||
../../modules/networking.nix
|
||||
../../modules/users.nix
|
||||
../../modules/audio.nix
|
||||
../../modules/printing.nix
|
||||
../../modules/localization.nix
|
||||
../../modules/x.nix
|
||||
];
|
||||
imports = [
|
||||
./hard.nix
|
||||
./disk.nix
|
||||
../../modules/bootloader.nix
|
||||
../../modules/networking.nix
|
||||
../../modules/users.nix
|
||||
../../modules/audio.nix
|
||||
../../modules/printing.nix
|
||||
../../modules/localization.nix
|
||||
../../modules/x.nix
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
# These are needed for ZFS
|
||||
|
||||
networking.hostId = "25698a58";
|
||||
# https://discourse.nixos.org/t/zfs-with-disko-faluire-to-import-zfs-pool/61988/3
|
||||
boot = {
|
||||
zfs = {
|
||||
devNodes = "/dev/disk/by-uuid";
|
||||
};
|
||||
};
|
||||
disko.devices.disk.main.device = "/dev/vda";
|
||||
|
||||
programs.git.enable = true;
|
||||
programs.firefox.enable = true;
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [ neovim ];
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
kitty
|
||||
];
|
||||
|
||||
services.spice-vdagentd.enable = true;
|
||||
services.openssh = {
|
||||
|
||||
@@ -1 +1,42 @@
|
||||
import ../../modules/disko.zfs-encrypted-root.nix
|
||||
# USAGE in your configuration.nix.
|
||||
# Update devices to match your hardware.
|
||||
# {
|
||||
# imports = [ ./disko-config.nix ];
|
||||
# disko.devices.disk.main.device = "/dev/sda";
|
||||
# }
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
};
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"xhci_pci"
|
||||
"virtio_pci"
|
||||
"sr_mod"
|
||||
"virtio_blk"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
{
|
||||
networking.hostName = "nixos";
|
||||
networking.wireless = { iwd = { enable = true; }; };
|
||||
networking.wireless = {
|
||||
iwd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 22 ];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
{
|
||||
services.printing.enable = true;
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
{
|
||||
services.xserver.windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
config = builtins.readFile ../dots/.xmonad/xmonad.hs;
|
||||
};
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
config = builtins.readFile ../dots/.xmonad/xmonad.hs;
|
||||
};
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
Reference in New Issue
Block a user