1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

chore: text with fake disko config

This commit is contained in:
oddlama 2022-11-27 00:13:46 +01:00
parent ac033f5aef
commit 8d107a7cf1
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 518 additions and 34 deletions

View file

@ -0,0 +1,41 @@
{
nom = {
disk = {
nvme0n1 = {
device = "/dev/nvme0n1";
type = "disk";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "ESP";
start = "1MiB";
end = "100MiB";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
name = "root";
type = "partition";
start = "100MiB";
end = "100%";
part-type = "primary";
bootable = true;
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
}
];
};
};
};
};
}

View file

@ -16,7 +16,7 @@
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.kernelModules = [];
boot.extraModulePackages = [];
networking.useDHCP = lib.mkDefault true;

View file

@ -58,7 +58,6 @@
# Select internationalisation properties.
i18n.defaultLocale = "C.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "de-latin1-nodeadkeys";
};
@ -81,17 +80,9 @@
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
xclip
tty-share
alacritty
element-desktop
kitty
firefox
chromium
enpass
# Office
libreoffice
onlyoffice-bin
beancount
fava
direnv
# Git & Tools
@ -139,17 +130,17 @@
rerere.enable = true;
};
};
programs.ssh = {
extraConfig = ''
Host github.com
User git
Hostname github.com
IdentityFile ~/.ssh/lar
Host gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/lar
'';
};
#programs.ssh = {
# extraConfig = ''
# Host github.com
# User git
# Hostname github.com
# IdentityFile ~/.ssh/lar
# Host gitlab.com
# PreferredAuthentications publickey
# IdentityFile ~/.ssh/lar
# '';
#};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

452
flake.lock generated Normal file
View file

@ -0,0 +1,452 @@
{
"nodes": {
"blank": {
"locked": {
"lastModified": 1625557891,
"narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=",
"owner": "divnix",
"repo": "blank",
"rev": "5a5d2684073d9f563072ed07c871d577a6c614a8",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "blank",
"type": "github"
}
},
"colmena": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": [
"std",
"flake-utils"
],
"nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": [
"nixpkgs"
],
"stable": [
"std",
"blank"
]
},
"locked": {
"lastModified": 1668384235,
"narHash": "sha256-bt2drRd1v+efic9MLnO3KI2x96g+J4TxhKiQQKqvyik=",
"owner": "zhaofengli",
"repo": "colmena",
"rev": "fff97f729086b4fc463e30d33d3350bcfa2838bb",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "colmena",
"type": "github"
}
},
"devshell": {
"inputs": {
"flake-utils": [
"std",
"flake-utils"
],
"nixpkgs": [
"std",
"nixpkgs"
]
},
"locked": {
"lastModified": 1663445644,
"narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=",
"owner": "numtide",
"repo": "devshell",
"rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1669394200,
"narHash": "sha256-Dfo27RuhJDKdatCaWk2jMZkjhcRI7A0+1rhypP8XDxI=",
"owner": "nix-community",
"repo": "disko",
"rev": "6bbdafce48bbd8a076e7f27bff17ea8fe6f531d4",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"dmerge": {
"inputs": {
"nixlib": [
"std",
"nixpkgs"
],
"yants": [
"std",
"yants"
]
},
"locked": {
"lastModified": 1659548052,
"narHash": "sha256-fzI2gp1skGA8mQo/FBFrUAtY0GQkAIAaV/V127TJPyY=",
"owner": "divnix",
"repo": "data-merge",
"rev": "d160d18ce7b1a45b88344aa3f13ed1163954b497",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "data-merge",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1669328018,
"narHash": "sha256-aJRMobnNDEXKwoSZFS4hGjGU1WDNxkQ82BVKAEohOfY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "62cb5bcf93896e4dd6b4507dac7ba2e2e3abc9d7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"incl": {
"inputs": {
"nixlib": [
"std",
"nixpkgs"
]
},
"locked": {
"lastModified": 1669263024,
"narHash": "sha256-E/+23NKtxAqYG/0ydYgxlgarKnxmDbg6rCMWnOBqn9Q=",
"owner": "divnix",
"repo": "incl",
"rev": "ce7bebaee048e4cd7ebdb4cee7885e00c4e2abca",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "incl",
"type": "github"
}
},
"n2c": {
"inputs": {
"flake-utils": [
"std",
"flake-utils"
],
"nixpkgs": [
"std",
"nixpkgs"
]
},
"locked": {
"lastModified": 1665039323,
"narHash": "sha256-SAh3ZjFGsaCI8FRzXQyp56qcGdAqgKEfJWPCQ0Sr7tQ=",
"owner": "nlewo",
"repo": "nix2container",
"rev": "b008fe329ffb59b67bf9e7b08ede6ee792f2741a",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "nix2container",
"type": "github"
}
},
"nix-eval-jobs": {
"inputs": {
"flake-utils": [
"colmena",
"flake-utils"
],
"nixpkgs": [
"colmena",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660713017,
"narHash": "sha256-w6KLNkT/2fI7UvPg3NoKj7gve4CgUHpyWOFq0BUwW7o=",
"owner": "zhaofengli",
"repo": "nix-eval-jobs",
"rev": "b4c078a4870c5b1a5b74420ca1dca41f4d75b7cc",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"ref": "colmena",
"repo": "nix-eval-jobs",
"type": "github"
}
},
"nixago": {
"inputs": {
"flake-utils": [
"std",
"flake-utils"
],
"nixago-exts": [
"std",
"blank"
],
"nixpkgs": [
"std",
"nixpkgs"
]
},
"locked": {
"lastModified": 1661824785,
"narHash": "sha256-/PnwdWoO/JugJZHtDUioQp3uRiWeXHUdgvoyNbXesz8=",
"owner": "nix-community",
"repo": "nixago",
"rev": "8c1f9e5f1578d4b2ea989f618588d62a335083c3",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixago",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": [
"nixpkgs"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1669065280,
"narHash": "sha256-3+pq1oJWjGDLfd8G/vR3IIFZ+EQ/aglukA0bTiMlf3o=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "50aeec40f2072d2ab267c8ec8a345573704ec110",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1669146234,
"narHash": "sha256-HEby7EG1yaq1oT2Ze6Cvok9CFju1XHkSvVHmkptLW9U=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "0099253ad0b5283f06ffe31cf010af3f9ad7837d",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1667629849,
"narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3bacde6273b09a21a8ccfba15586fb165078fb62",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1669411043,
"narHash": "sha256-LfPd3+EY+jaIHTRIEOUtHXuanxm59YKgUacmSzaqMLc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5dc7114b7b256d217fe7752f1614be2514e61bb8",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nosys": {
"locked": {
"lastModified": 1667881534,
"narHash": "sha256-FhwJ15uPLRsvaxtt/bNuqE/ykMpNAPF0upozFKhTtXM=",
"owner": "divnix",
"repo": "nosys",
"rev": "2d0d5207f6a230e9d0f660903f8db9807b54814f",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "nosys",
"type": "github"
}
},
"root": {
"inputs": {
"colmena": "colmena",
"disko": "disko",
"home": "home",
"nixos": [
"nixpkgs"
],
"nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"std": "std"
}
},
"std": {
"inputs": {
"arion": [
"std",
"blank"
],
"blank": "blank",
"devshell": "devshell",
"dmerge": "dmerge",
"flake-utils": "flake-utils",
"incl": "incl",
"makes": [
"std",
"blank"
],
"mdbook-kroki-preprocessor": [
"std",
"blank"
],
"microvm": [
"std",
"blank"
],
"n2c": "n2c",
"nixago": "nixago",
"nixpkgs": [
"nixpkgs"
],
"nosys": "nosys",
"yants": "yants"
},
"locked": {
"lastModified": 1669263222,
"narHash": "sha256-Adg/36FHAC3j8HBie997YmUGDf4gdvO9IuDCRXMEkyc=",
"owner": "divnix",
"repo": "std",
"rev": "5990c894cff6a05617fb254c82251907e5a60dab",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "std",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"yants": {
"inputs": {
"nixpkgs": [
"std",
"nixpkgs"
]
},
"locked": {
"lastModified": 1667096281,
"narHash": "sha256-wRRec6ze0gJHmGn6m57/zhz/Kdvp9HS4Nl5fkQ+uIuA=",
"owner": "divnix",
"repo": "yants",
"rev": "d18f356ec25cb94dc9c275870c3a7927a10f8c3c",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "yants",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -80,8 +80,8 @@
};
};
checkAndTransformConfigFor = user: target: out: config: let
_file = "github:divnix/hive: ./comb/${user}; target: ${target}";
checkAndTransformConfigFor = site: target: out: config: let
_file = "github:divnix/hive: ./comb/${site}; target: ${target}";
locatedConfig = {
imports = [config];
inherit _file;
@ -99,21 +99,21 @@
/*
We start with:
${system}.${user}.${cellBlock}.${machine} = config;
${system}.${site}.${cellBlock}.${machine} = config;
We want:
${user}.${machine} = config; (filtered by system)
${machine}@${site} = config; (filtered by system)
*/
pasteurize = self:
l.pipe
(
l.mapAttrs (system:
l.mapAttrs (user: blocks: (
l.mapAttrs (site: blocks: (
l.pipe blocks [
(l.attrByPath [cellBlock] {})
(l.mapAttrs (machine:
checkAndTransformConfigFor user machine (
checkAndTransformConfigFor site machine (
asserted: {
environment.etc."nixos/configuration.nix".text = ''
throw '''
@ -127,7 +127,7 @@
}
)))
(l.filterAttrs (_: config: config.nixpkgs.system == system))
(l.mapAttrs (machine: l.nameValuePair "${user}.${machine}"))
(l.mapAttrs (machine: l.nameValuePair "${machine}@${site}"))
]
)))
(l.intersectAttrs (l.genAttrs l.systems.doubles.all (_: null)) self)
@ -147,11 +147,11 @@
l.pipe
(
l.mapAttrs (system:
l.mapAttrs (user: blocks: (
l.mapAttrs (site: blocks: (
l.pipe blocks [
(l.attrByPath [cellBlock] {})
(l.mapAttrs (homecfg:
checkAndTransformConfigFor user homecfg (
checkAndTransformConfigFor site homecfg (
# We switched off the home-manager nimpkgs module since it
# does a re-import (and we don't tolerate that interface)
# so we re-use bee to communicate with the shake function
@ -159,7 +159,7 @@
asserted: {bee = {inherit (asserted.bee) system pkgs home;};}
)))
(l.filterAttrs (_: config: config.bee.system == system))
(l.mapAttrs (homecfg: l.nameValuePair "${user}.${homecfg}"))
(l.mapAttrs (homecfg: l.nameValuePair "${homecfg}@${site}"))
]
)))
(l.intersectAttrs (l.genAttrs l.systems.doubles.all (_: null)) self)
@ -198,11 +198,11 @@
l.pipe
(
l.mapAttrs (system:
l.mapAttrs (user: blocks: (
l.mapAttrs (site: blocks: (
l.pipe blocks [
(l.attrByPath [cellBlock] {})
(l.filterAttrs (_: _: "x86_64-linux" == system)) # pick one
(l.mapAttrs (disko: l.nameValuePair "${user}.${disko}"))
(l.mapAttrs (disko: l.nameValuePair "${disko}.${site}"))
]
)))
(l.intersectAttrs (l.genAttrs l.systems.doubles.all (_: null)) self)