Compare commits
18 Commits
Author | SHA1 | Date |
---|---|---|
|
069a3b8333 | |
|
851f226518 | |
|
7b872f4596 | |
|
84ec0824e8 | |
|
8f2c473219 | |
|
475c21cbac | |
|
671578567a | |
|
f92ed39653 | |
|
91a1c7f6ca | |
|
fc7e346f1e | |
|
0da72e9513 | |
|
749bd75992 | |
|
54b228381d | |
|
ee62f092e5 | |
|
6007760092 | |
|
f8fddbba14 | |
|
f824649f85 | |
|
c4fe75a1b9 |
|
@ -3,3 +3,4 @@
|
||||||
result
|
result
|
||||||
result-*
|
result-*
|
||||||
|
|
||||||
|
nixos-efi-vars.fd
|
||||||
|
|
14
README.md
14
README.md
|
@ -1,9 +1,15 @@
|
||||||
# nixos
|
# 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
|
nix build -L '.#nixosConfigurations.vm.config.system.build.vmWithDisko'
|
||||||
cd nix
|
```
|
||||||
sudo nix run 'github:nix-community/disko/latest#disko-install' -- --flake .#vm --disk root /dev/vda
|
|
||||||
|
2. Run the virtual machine
|
||||||
|
|
||||||
|
```
|
||||||
|
./result/bin/disko-vm
|
||||||
```
|
```
|
||||||
|
|
|
@ -44,11 +44,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759439645,
|
"lastModified": 1759580034,
|
||||||
"narHash": "sha256-oiAyQaRilPk525Z5aTtTNWNzSrcdJ7IXM0/PL3CGlbI=",
|
"narHash": "sha256-YWo57PL7mGZU7D4WeKFMiW4ex/O6ZolUS6UNBHTZfkI=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "879bd460b3d3e8571354ce172128fbcbac1ed633",
|
"rev": "3bcc93c5f7a4b30335d31f21e2f1281cba68c318",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -13,18 +13,23 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, disko, home-manager }: {
|
outputs =
|
||||||
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
disko,
|
||||||
|
home-manager,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixosConfigurations = {
|
||||||
|
vm = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/vm/configuration.nix
|
|
||||||
disko.nixosModules.disko
|
disko.nixosModules.disko
|
||||||
home-manager.nixosModules.home-manager {
|
home-manager.nixosModules.home-manager
|
||||||
home-manager.useGlobalPkgs = true;
|
./hosts/vm/configuration.nix
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.h = ./hosts/vm/home.nix;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
{ pkgs, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
system.stateVersion = "25.05";
|
system.stateVersion = "25.05";
|
||||||
|
|
||||||
imports =
|
imports = [
|
||||||
[
|
|
||||||
./hard.nix
|
./hard.nix
|
||||||
./disk.nix
|
./disk.nix
|
||||||
../../modules/bootloader.nix
|
../../modules/bootloader.nix
|
||||||
|
@ -16,26 +15,40 @@
|
||||||
../../modules/x.nix
|
../../modules/x.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
|
||||||
# These are needed for ZFS
|
disko = {
|
||||||
|
devices.disk.main.device = "/dev/vda";
|
||||||
networking.hostId = "25698a58";
|
devices.disk.main.imageName = "nixos-vm";
|
||||||
# https://discourse.nixos.org/t/zfs-with-disko-faluire-to-import-zfs-pool/61988/3
|
devices.disk.main.imageSize = "32G";
|
||||||
boot = {
|
|
||||||
zfs = {
|
|
||||||
devNodes = "/dev/disk/by-uuid";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.git.enable = true;
|
virtualisation.vmVariantWithDisko = {
|
||||||
programs.firefox.enable = true;
|
virtualisation = {
|
||||||
|
cores = 8;
|
||||||
|
memorySize = 16384;
|
||||||
|
qemu.options = [
|
||||||
|
"-enable-kvm"
|
||||||
|
"-cpu host"
|
||||||
|
"-nographic"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ neovim ];
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
users.h = ./home.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.qemuGuest.enable = true;
|
||||||
services.spice-vdagentd.enable = true;
|
services.spice-vdagentd.enable = true;
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
startWhenNeeded = true;
|
startWhenNeeded = true;
|
||||||
|
|
|
@ -1 +1,36 @@
|
||||||
import ../../modules/disko.zfs-encrypted-root.nix
|
{
|
||||||
|
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’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
(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.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
|
@ -6,7 +6,81 @@
|
||||||
home.username = "h";
|
home.username = "h";
|
||||||
home.homeDirectory = "/home/h";
|
home.homeDirectory = "/home/h";
|
||||||
|
|
||||||
home.file.".inputrc".source = ../../dots/.inputrc;
|
programs = {
|
||||||
|
bash = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
initExtra = ''
|
||||||
|
for f in ${config.home.homeDirectory}/.bashrc.d/*; do
|
||||||
|
[ -f "$f" ] && source "$f"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
firefox.enable = true;
|
||||||
|
fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
};
|
||||||
|
git.enable = true;
|
||||||
|
home-manager.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
home.packages = with pkgs; [
|
||||||
|
bash-completion
|
||||||
|
bash-language-server
|
||||||
|
bat
|
||||||
|
brightnessctl
|
||||||
|
entr
|
||||||
|
eslint_d
|
||||||
|
feh
|
||||||
|
firefox-devedition
|
||||||
|
fzf
|
||||||
|
git
|
||||||
|
haskell-language-server
|
||||||
|
haskellPackages.pandoc-crossref
|
||||||
|
haskellPackages.hadolint
|
||||||
|
htop
|
||||||
|
iosevka
|
||||||
|
jq
|
||||||
|
keepassxc
|
||||||
|
kitty
|
||||||
|
lua-language-server
|
||||||
|
neovim
|
||||||
|
nmap
|
||||||
|
nodejs_24
|
||||||
|
nodePackages.ts-node
|
||||||
|
nvimpager
|
||||||
|
ormolu
|
||||||
|
pandoc
|
||||||
|
parallel
|
||||||
|
pass
|
||||||
|
pnpm
|
||||||
|
ripgrep
|
||||||
|
silver-searcher
|
||||||
|
sshfs
|
||||||
|
stylelint
|
||||||
|
svelte-language-server
|
||||||
|
tailwindcss-language-server
|
||||||
|
taskwarrior3
|
||||||
|
tldr
|
||||||
|
tmux
|
||||||
|
tmuxp
|
||||||
|
tree
|
||||||
|
tree-sitter
|
||||||
|
typescript-language-server
|
||||||
|
unzip
|
||||||
|
vim-language-server
|
||||||
|
vimPlugins.vim-plug
|
||||||
|
vtsls
|
||||||
|
wget
|
||||||
|
xbanish
|
||||||
|
xclip
|
||||||
|
yaml-language-server
|
||||||
|
];
|
||||||
|
|
||||||
|
home.file = {
|
||||||
|
".inputrc".source = ../../dots/.inputrc;
|
||||||
|
".bashrc.d/prompt".source = ../../dots/.bashrc.d/prompt;
|
||||||
|
".bashrc.d/editor".source = ../../dots/.bashrc.d/editor;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
networking.hostName = "nixos";
|
networking.hostName = "nixos";
|
||||||
networking.wireless = { iwd = { enable = true; }; };
|
networking.wireless = {
|
||||||
|
iwd = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [ 22 ];
|
allowedTCPPorts = [ 22 ];
|
||||||
|
|
Loading…
Reference in New Issue