From 0cab03eecab8d907725964b7b64afda69a5c8eec Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sat, 9 Apr 2022 21:33:13 +0300 Subject: [PATCH] drop fup --- CHANGELOG.md | 114 ----- flake.lock | 424 ++---------------- flake.nix | 135 +----- hosts/default.nix | 22 + hosts/lungmen/default.nix | 85 ++-- lib/default.nix | 10 + lib/systems.nix | 1 + {profiles => modules/base}/default.nix | 47 +- modules/{ => base}/hm-system-defaults.nix | 1 + modules/base/nix.nix | 23 + {profiles => modules}/cachix/default.nix | 2 +- {profiles => modules}/cachix/harmony.nix | 0 .../cachix/nix-cargo-integration.nix | 0 .../cachix/nix-community.nix | 0 .../cachix/nixpkgs-wayland.nix | 0 {profiles => modules}/cachix/nrdxp.nix | 0 {profiles => modules}/cachix/veloren-nix.nix | 0 modules/default.nix | 4 +- {profiles => modules}/develop/default.nix | 0 .../develop/editor/default.nix | 0 .../develop/editor/helix.nix | 0 .../develop/editor/kakoune.nix | 0 {profiles => modules}/develop/godot.nix | 0 {profiles => modules}/network/default.nix | 0 {profiles => modules}/network/dns/default.nix | 0 {profiles => modules}/network/dns/nextdns.nix | 0 .../network/dns/stubby/default.nix | 0 .../network/dns/stubby/nextdns.nix | 0 {profiles => modules}/network/iwd.nix | 0 .../network/networkmanager/default.nix | 0 {profiles => modules}/network/ssh.nix | 0 .../network/wpa_supplicant.nix | 0 pkgs-set/default.nix | 19 + pkgs-set/from-unstable.nix | 9 + .../overlays}/chromium-wayland.nix | 0 .../overlays}/discord-canary-system.nix | 0 .../overlays}/discord-canary.nix | 0 {overlays => pkgs-set/overlays}/phantom.nix | 0 .../overlays}/vscode-wayland.nix | 0 shells/default.nix | 9 + .../{profiles => modules}/direnv/default.nix | 0 users/{profiles => modules}/git/default.nix | 0 .../{profiles => modules}/hikari/default.nix | 0 .../starship/default.nix | 0 users/{profiles => modules}/wtf/default.nix | 0 users/patriot/default.nix | 14 +- 46 files changed, 200 insertions(+), 719 deletions(-) delete mode 100644 CHANGELOG.md create mode 100644 hosts/default.nix create mode 100644 lib/default.nix create mode 100644 lib/systems.nix rename {profiles => modules/base}/default.nix (80%) rename modules/{ => base}/hm-system-defaults.nix (87%) create mode 100644 modules/base/nix.nix rename {profiles => modules}/cachix/default.nix (84%) rename {profiles => modules}/cachix/harmony.nix (100%) rename {profiles => modules}/cachix/nix-cargo-integration.nix (100%) rename {profiles => modules}/cachix/nix-community.nix (100%) rename {profiles => modules}/cachix/nixpkgs-wayland.nix (100%) rename {profiles => modules}/cachix/nrdxp.nix (100%) rename {profiles => modules}/cachix/veloren-nix.nix (100%) rename {profiles => modules}/develop/default.nix (100%) rename {profiles => modules}/develop/editor/default.nix (100%) rename {profiles => modules}/develop/editor/helix.nix (100%) rename {profiles => modules}/develop/editor/kakoune.nix (100%) rename {profiles => modules}/develop/godot.nix (100%) rename {profiles => modules}/network/default.nix (100%) rename {profiles => modules}/network/dns/default.nix (100%) rename {profiles => modules}/network/dns/nextdns.nix (100%) rename {profiles => modules}/network/dns/stubby/default.nix (100%) rename {profiles => modules}/network/dns/stubby/nextdns.nix (100%) rename {profiles => modules}/network/iwd.nix (100%) rename {profiles => modules}/network/networkmanager/default.nix (100%) rename {profiles => modules}/network/ssh.nix (100%) rename {profiles => modules}/network/wpa_supplicant.nix (100%) create mode 100644 pkgs-set/default.nix create mode 100644 pkgs-set/from-unstable.nix rename {overlays => pkgs-set/overlays}/chromium-wayland.nix (100%) rename {overlays => pkgs-set/overlays}/discord-canary-system.nix (100%) rename {overlays => pkgs-set/overlays}/discord-canary.nix (100%) rename {overlays => pkgs-set/overlays}/phantom.nix (100%) rename {overlays => pkgs-set/overlays}/vscode-wayland.nix (100%) create mode 100644 shells/default.nix rename users/{profiles => modules}/direnv/default.nix (100%) rename users/{profiles => modules}/git/default.nix (100%) rename users/{profiles => modules}/hikari/default.nix (100%) rename users/{profiles => modules}/starship/default.nix (100%) rename users/{profiles => modules}/wtf/default.nix (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index b8d9a68..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,114 +0,0 @@ -# Changelog - -## [v0.10.0](https://github.com/divnix/devos/tree/v0.10.0) (2021-05-24) - -**Implemented enhancements:** - -- Providing an interface to nixpkgs.config [\#237](https://github.com/divnix/devos/issues/237) -- Making the user available in profiles [\#230](https://github.com/divnix/devos/issues/230) -- copy evaluation store paths to iso [\#195](https://github.com/divnix/devos/issues/195) -- Extract custom system builds from devosSystem out of lib [\#170](https://github.com/divnix/devos/issues/170) -- Allow setting of channel host-wide [\#117](https://github.com/divnix/devos/issues/117) -- alacritty: CSIu support [\#51](https://github.com/divnix/devos/issues/51) - -**Fixed bugs:** - -- Cachix timeouts + how to disable nrdxp cachix \(if needed\) [\#294](https://github.com/divnix/devos/issues/294) -- default.nix flake-compat is broken [\#285](https://github.com/divnix/devos/issues/285) -- All suites return "attribute missing" [\#282](https://github.com/divnix/devos/issues/282) -- nix is built two times [\#203](https://github.com/divnix/devos/issues/203) -- fix lib docs [\#166](https://github.com/divnix/devos/issues/166) - -**Closed issues:** - -- eliminate userFlakeNixOS [\#257](https://github.com/divnix/devos/issues/257) -- devos-as-library [\#214](https://github.com/divnix/devos/issues/214) - -**Merged pull requests:** - -- Update evalArgs to match the new planned API [\#239](https://github.com/divnix/devos/pull/239) - -## [v0.9.0](https://github.com/divnix/devos/tree/v0.9.0) (2021-04-19) - -**Implemented enhancements:** - -- pin inputs into iso live registry [\#190](https://github.com/divnix/devos/issues/190) -- Pass 'self' to lib [\#169](https://github.com/divnix/devos/issues/169) -- doc: quickstart "ISO. What next?" [\#167](https://github.com/divnix/devos/issues/167) -- Integrate Android AOSP putting mobile under control [\#149](https://github.com/divnix/devos/issues/149) -- Inoculate host identity on first use [\#132](https://github.com/divnix/devos/issues/132) -- kubenix support [\#130](https://github.com/divnix/devos/issues/130) -- Improve Home Manager support: profiles/suites, modules, extern, flake outputs [\#119](https://github.com/divnix/devos/issues/119) -- Local CA \(between hosts\) [\#104](https://github.com/divnix/devos/issues/104) -- Q5: git annex for machine state [\#68](https://github.com/divnix/devos/issues/68) -- name space ./pkgs overlays [\#60](https://github.com/divnix/devos/issues/60) -- remap global keys easily [\#57](https://github.com/divnix/devos/issues/57) -- make pass state part of this repo's structure [\#56](https://github.com/divnix/devos/issues/56) -- Incorporate ./shells [\#38](https://github.com/divnix/devos/issues/38) -- Encrypt with \(r\)age [\#37](https://github.com/divnix/devos/issues/37) - -**Fixed bugs:** - -- `pathsToImportedAttrs` does not accept directories [\#221](https://github.com/divnix/devos/issues/221) -- Cachix caches aren't added to the configuration [\#208](https://github.com/divnix/devos/issues/208) -- Issues with current changelog workflow [\#205](https://github.com/divnix/devos/issues/205) -- iso: systemd service startup [\#194](https://github.com/divnix/devos/issues/194) -- Help adding easy-hls-nix to devos [\#174](https://github.com/divnix/devos/issues/174) -- `flk update` fails because of obsolete flag [\#159](https://github.com/divnix/devos/issues/159) -- Expected that not all packages are exported? [\#151](https://github.com/divnix/devos/issues/151) -- Segmentation fault when generating iso [\#150](https://github.com/divnix/devos/issues/150) - -**Documentation:** - -- doc: split iso [\#193](https://github.com/divnix/devos/issues/193) -- lib: can depend on pkgs \(a la nixpkgs\#pkgs/pkgs-lib\) [\#147](https://github.com/divnix/devos/pull/147) - -**Closed issues:** - -- FRRouting router implementation [\#154](https://github.com/divnix/devos/issues/154) -- ARM aarch64 Support [\#72](https://github.com/divnix/devos/issues/72) - -## [v0.8.0](https://github.com/divnix/devos/tree/v0.8.0) (2021-03-02) - -**Implemented enhancements:** - -- semi automatic update for /pkgs [\#118](https://github.com/divnix/devos/issues/118) -- Home-manager external modules from flakes [\#106](https://github.com/divnix/devos/issues/106) - -**Fixed bugs:** - -- My emacsGcc overlay is not working [\#146](https://github.com/divnix/devos/issues/146) -- local flake registry freezes branches [\#142](https://github.com/divnix/devos/issues/142) -- nixos-option no longer works after collect garbage [\#138](https://github.com/divnix/devos/issues/138) -- Profiles imports are brittle, causing failure if imported twice [\#136](https://github.com/divnix/devos/issues/136) - -## [0.7.0](https://github.com/divnix/devos/tree/0.7.0) (2021-02-20) - -**Implemented enhancements:** - -- add zoxide [\#53](https://github.com/divnix/devos/issues/53) -- Multiarch support? [\#17](https://github.com/divnix/devos/issues/17) -- initial multiArch support [\#18](https://github.com/divnix/devos/pull/18) - -**Fixed bugs:** - -- Missing shebang from flk.sh [\#131](https://github.com/divnix/devos/issues/131) -- Rename Meta Issue [\#128](https://github.com/divnix/devos/issues/128) -- specialisations break the `system` argument [\#46](https://github.com/divnix/devos/issues/46) -- Revert "Add extraArgs to lib.nixosSystem call to add system args." [\#47](https://github.com/divnix/devos/pull/47) - -**Documentation:** - -- update home-manager urls [\#62](https://github.com/divnix/devos/pull/62) - -**Closed issues:** - -- add github action for cachix build ci [\#59](https://github.com/divnix/devos/issues/59) - -## [12052020](https://github.com/divnix/devos/tree/12052020) (2020-12-06) - -## [07092020](https://github.com/divnix/devos/tree/07092020) (2020-07-09) - - - -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/flake.lock b/flake.lock index 0d1b1c6..543aaa4 100644 --- a/flake.lock +++ b/flake.lock @@ -1,251 +1,5 @@ { "nodes": { - "alejandra": { - "inputs": { - "flakeCompat": "flakeCompat", - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1649191071, - "narHash": "sha256-35hEJuMvRswOPKb9lbB9ZuHVe0eJN6WJc4T8Frn0hYQ=", - "owner": "kamadorueda", - "repo": "alejandra", - "rev": "3d3f24127a8e2b28998a81c444f8b4b4f11da6c6", - "type": "github" - }, - "original": { - "owner": "kamadorueda", - "repo": "alejandra", - "type": "github" - } - }, - "cachix": { - "locked": { - "lastModified": 1642244250, - "narHash": "sha256-vWpUEqQdVP4srj+/YLJRTN9vjpTs4je0cdWKXPbDItc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0fd9ee1aa36ce865ad273f4f07fdc093adeb5c00", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-21.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "crane": { - "flake": false, - "locked": { - "lastModified": 1644785799, - "narHash": "sha256-VpAJO1L0XeBvtCuNGK4IDKp6ENHIpTrlaZT7yfBCvwo=", - "owner": "ipetkov", - "repo": "crane", - "rev": "fc7a94f841347c88f2cb44217b2a3faa93e2a0b2", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "devshell": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixCargoIntegration", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1647857022, - "narHash": "sha256-Aw70NWLOIwKhT60MHDGjgWis3DP3faCzr6ap9CSayek=", - "owner": "numtide", - "repo": "devshell", - "rev": "0a5ff74dacb9ea22614f64e61aeb3ca0bf0e7311", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "dream2nix": { - "inputs": { - "alejandra": [ - "nixCargoIntegration", - "nixpkgs" - ], - "crane": "crane", - "flake-utils-pre-commit": [ - "nixCargoIntegration", - "nixpkgs" - ], - "gomod2nix": [ - "nixCargoIntegration", - "nixpkgs" - ], - "mach-nix": [ - "nixCargoIntegration", - "nixpkgs" - ], - "nixpkgs": [ - "nixCargoIntegration", - "nixpkgs" - ], - "node2nix": [ - "nixCargoIntegration", - "nixpkgs" - ], - "poetry2nix": [ - "nixCargoIntegration", - "nixpkgs" - ], - "pre-commit-hooks": [ - "nixCargoIntegration", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1649088506, - "narHash": "sha256-rIpLWnomSDYlaZfQiXs4Ui3EqmiY6d9qEkIY/vzZg6s=", - "owner": "nix-community", - "repo": "dream2nix", - "rev": "84135ea205bcc04648fcc7776261e1dcb6e78ceb", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "dream2nix", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1637014545, - "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flakeCompat": { - "flake": false, - "locked": { - "lastModified": 1648199409, - "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "fup": { - "inputs": { - "flake-utils": "flake-utils" - }, - "locked": { - "lastModified": 1647259887, - "narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "type": "github" - } - }, - "helix": { - "inputs": { - "nixCargoIntegration": [ - "nixCargoIntegration" - ], - "nixpkgs": [ - "nixos" - ], - "rust-overlay": [ - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1649456512, - "narHash": "sha256-evrtUI3NkwEhQGJmRPnDqvoYex3SnH9NAxgCLJw2v3s=", - "owner": "helix-editor", - "repo": "helix", - "rev": "7779dbfcb847e9aa20e01ae0f8354c3c0de38fe3", - "type": "github" - }, - "original": { - "owner": "helix-editor", - "repo": "helix", - "type": "github" - } - }, "home": { "inputs": { "nixpkgs": [ @@ -267,52 +21,7 @@ "type": "github" } }, - "naersk": { - "inputs": { - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1649096192, - "narHash": "sha256-7O8e+eZEYeU+ET98u/zW5epuoN/xYx9G+CIh4DjZVzY=", - "owner": "nmattia", - "repo": "naersk", - "rev": "d626f73332a8f587b613b0afe7293dd0777be07d", - "type": "github" - }, - "original": { - "owner": "nmattia", - "repo": "naersk", - "type": "github" - } - }, - "nixCargoIntegration": { - "inputs": { - "devshell": "devshell", - "dream2nix": "dream2nix", - "nixpkgs": [ - "nixos" - ], - "rustOverlay": [ - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1649398335, - "narHash": "sha256-SjE4w4kcg3NphapPwBMiIdZDLvVqEf9+IfIskQMd4OY=", - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "rev": "791bf70e720869431479bd4f2133e466b13fe088", - "type": "github" - }, - "original": { - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "type": "github" - } - }, - "nixos": { + "latest": { "locked": { "lastModified": 1649225869, "narHash": "sha256-u1zLtPmQzhT9mNXyM8Ey9pk7orDrIKdwooeGDEXm5xM=", @@ -328,13 +37,29 @@ "type": "github" } }, - "nixosHardware": { + "nixos": { "locked": { - "lastModified": 1649401245, - "narHash": "sha256-mce0dpugKD9qgFgzloE2yoYJRD6Bvsy2QDzODpXMsss=", + "lastModified": 1649504202, + "narHash": "sha256-k7BZoTGeNqz+jy0v0kKl3jSa+6Q4Dx1FPpZFF9+u9nA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "27b0c3988745d1b18607744badaf2add79c8bcea", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "release-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1649488242, + "narHash": "sha256-GFahTvlMnqotZ8i1AO3J8OtVFrJe4QHcEPxpFH+DIEw=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "ddeb6a0aa430914674d6f0bc1646cf11e799a5bb", + "rev": "850308db3ef0bcc7454155063b5fec28b4ffbc8c", "type": "github" }, "original": { @@ -343,7 +68,7 @@ "type": "github" } }, - "nixosPersistence": { + "nixos-persistence": { "locked": { "lastModified": 1646131459, "narHash": "sha256-GPmgxvUFvQ1GmsGfWHy9+rcxWrczeDhS9XnAIPHi9XQ=", @@ -358,112 +83,13 @@ "type": "github" } }, - "nixpkgs": { - "locked": { - "lastModified": 1645433236, - "narHash": "sha256-4va4MvJ076XyPp5h8sm5eMQvCrJ6yZAbBmyw95dGyw4=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "7f9b6e2babf232412682c09e57ed666d8f84ac2d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgsWayland": { - "inputs": { - "cachix": "cachix", - "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs" - }, - "locked": { - "narHash": "sha256-xwi46ruR5z4THe967gzW74dQhPmlS5FWSiWuo9aYquY=", - "path": "/nix/store/23by5yfsvzynznfjk2kjwn1gpb231fl9-source", - "type": "path" - }, - "original": { - "id": "nixpkgsWayland", - "type": "indirect" - } - }, - "rnixLsp": { - "inputs": { - "naersk": [ - "naersk" - ], - "nixpkgs": [ - "nixos" - ], - "utils": "utils" - }, - "locked": { - "lastModified": 1647240246, - "narHash": "sha256-/MLdBWfFUN1C1eNVBYfaVAIcDiZKXpWEbzBC2pqVXj0=", - "owner": "nix-community", - "repo": "rnix-lsp", - "rev": "4d1024ccfe1bc569811769d1ef52a2fc6c1d482d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "rnix-lsp", - "type": "github" - } - }, "root": { "inputs": { - "alejandra": "alejandra", - "fup": "fup", - "helix": "helix", "home": "home", - "naersk": "naersk", - "nixCargoIntegration": "nixCargoIntegration", + "latest": "latest", "nixos": "nixos", - "nixosHardware": "nixosHardware", - "nixosPersistence": "nixosPersistence", - "nixpkgsWayland": "nixpkgsWayland", - "rnixLsp": "rnixLsp", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1649447403, - "narHash": "sha256-JZMYKsCxpLpPKLVjDUVmKs/bVnbcaPa8crf2uKh0lKY=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "44801306a2aa0e9aaa47588d615ce6df4acf18c6", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "utils": { - "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" + "nixos-hardware": "nixos-hardware", + "nixos-persistence": "nixos-persistence" } } }, diff --git a/flake.nix b/flake.nix index 2af98ba..638b07d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,125 +1,30 @@ { - description = "A highly structured configuration database."; - inputs = { - nixos.url = "github:nixos/nixpkgs/nixos-unstable"; + description = "config!!!"; - fup.url = "github:gytis-ivaskevicius/flake-utils-plus"; + inputs = { + nixos.url = "github:nixos/nixpkgs/release-21.11"; + latest.url = "github:nixos/nixpkgs/nixos-unstable"; home.url = "github:nix-community/home-manager/release-21.11"; home.inputs.nixpkgs.follows = "nixos"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixos"; - }; - naersk.url = "github:nmattia/naersk"; - naersk.inputs.nixpkgs.follows = "nixos"; - nixCargoIntegration.url = "github:yusdacra/nix-cargo-integration"; - nixCargoIntegration.inputs.nixpkgs.follows = "nixos"; - nixCargoIntegration.inputs.rustOverlay.follows = "rust-overlay"; - - nixosHardware.url = "github:nixos/nixos-hardware"; - nixosPersistence.url = "github:nix-community/impermanence"; - - rnixLsp = { - url = "github:nix-community/rnix-lsp"; - inputs.naersk.follows = "naersk"; - inputs.nixpkgs.follows = "nixos"; - }; - alejandra = { - url = "github:kamadorueda/alejandra"; - inputs.nixpkgs.follows = "nixos"; - }; - helix = { - url = "github:helix-editor/helix"; - inputs.nixpkgs.follows = "nixos"; - inputs.rust-overlay.follows = "rust-overlay"; - inputs.nixCargoIntegration.follows = "nixCargoIntegration"; - }; + nixos-hardware.url = "github:nixos/nixos-hardware"; + nixos-persistence.url = "github:nix-community/impermanence"; }; - outputs = { - self, - fup, - home, - nixosHardware, - nixosPersistence, - nixpkgsWayland, - rnixLsp, - alejandra, - helix, - nixos, - ... - } @ inputs: - fup.lib.mkFlake - { - inherit self inputs; - supportedSystems = ["x86_64-linux"]; - channelsConfig.allowUnfree = true; - nix.generateRegistryFromInputs = true; - nix.generateNixPathFromInputs = true; - nix.linkInputs = true; - - sharedOverlays = [ - (_: prev: { - lib = prev.lib.extend (_: _: builtins); - }) - (_: prev: { - lib = prev.lib.extend (_: l: { - pkgBin = id: - if l.isString id - then "${prev.${id}}/bin/${id}" - else "${prev.${id.name}}/bin/${id.bin}"; - }); - }) - ]; - - channels.nixos = { - overlays = [ - ./overlays/chromium-wayland.nix - ./overlays/phantom.nix - ( - _: prev: { - helix = helix.packages.${prev.system}.helix; - rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp; - alejandra = alejandra.defaultPackage.${prev.system}; - } - ) - ]; - }; - - hostDefaults = { - channelName = "nixos"; - modules = [ - home.nixosModules.home-manager - ./profiles - ./modules - ./locale - ./secrets - ]; - }; - - hosts.lungmen = { - modules = with nixosHardware.nixosModules; [ - nixos.nixosModules.notDetected - nixosPersistence.nixosModules.impermanence - common-pc-ssd - common-pc - common-gpu-amd - common-cpu-amd - ./profiles/network/networkmanager - ./users/root - ./users/patriot - ./hosts/lungmen - ]; - }; - - outputsBuilder = channels: - with channels.nixos; { - devShell = mkShell { - name = "prts"; - buildInputs = [git git-crypt]; - }; + outputs = inputs: let + lib = (import ./lib inputs.nixos.lib).extend (_: lib: rec { + makePkgs = system: + import ./pkgs-set { + inherit system lib; + stable = inputs.nixos; + unstable = inputs.latest; }; - }; + genPkgs = f: lib.genSystems (system: f (makePkgs system)); + }); + in rec { + nixosConfigurations = import ./hosts {inherit lib inputs;}; + devShells = import ./shells {inherit lib inputs;}; + devShell = lib.mapAttrs (_: value: value.default) devShells; + }; } diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..1424914 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,22 @@ +{ + inputs, + lib, +}: let + baseModules = [ + ../modules + ../secrets + ../locale + inputs.home.nixosModule + ]; + + mkSystem = name: system: let + pkgs = lib.makePkgs system; + in + lib.nixosSystem { + inherit system; + modules = baseModules ++ [(import (./. + "/${name}/default.nix"))]; + specialArgs = {inherit inputs lib pkgs;}; + }; +in { + lungmen = mkSystem "lungmen" "x86_64-linux"; +} diff --git a/hosts/lungmen/default.nix b/hosts/lungmen/default.nix index 62902a4..ae13f60 100644 --- a/hosts/lungmen/default.nix +++ b/hosts/lungmen/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - modulesPath, + inputs, ... }: let btrfsPartPath = "/dev/disk/by-label/NIXOS"; @@ -38,10 +38,25 @@ sudo umount /mnt ''; in { + imports = with inputs; + with nixos-hardware.nixosModules; [ + nixos.nixosModules.notDetected + nixos-persistence.nixosModule + common-pc-ssd + common-pc + common-gpu-amd + common-cpu-amd + ../../modules/network/dns + ../../users/root + ../../users/patriot + ]; + boot = { + tmpOnTmpfs = true; loader = { efi.canTouchEfiVariables = true; systemd-boot.enable = true; + systemd-boot.configurationLimit = 10; }; kernelPackages = pkgs.linuxPackages_latest; supportedFilesystems = ["btrfs"]; @@ -70,20 +85,7 @@ in { ''; kernel.sysctl = {"fs.inotify.max_user_watches" = 524288;}; }; - security.pam.loginLimits = [ - { - domain = "*"; - type = "soft"; - item = "nofile"; - value = "524288"; - } - { - domain = "*"; - type = "hard"; - item = "nofile"; - value = "524288"; - } - ]; + fileSystems."/" = { device = btrfsPartPath; fsType = "btrfs"; @@ -114,13 +116,29 @@ in { device = "/dev/disk/by-uuid/5784-BBB1"; fsType = "vfat"; }; + swapDevices = []; zramSwap = { enable = true; algorithm = "zstd"; }; - nix.settings.max-jobs = lib.mkDefault 4; + + nix.maxJobs = lib.mkDefault 4; security = { + pam.loginLimits = [ + { + domain = "*"; + type = "soft"; + item = "nofile"; + value = "524288"; + } + { + domain = "*"; + type = "hard"; + item = "nofile"; + value = "524288"; + } + ]; allowSimultaneousMultithreading = false; # Deleting root subvolume makes sudo show lecture every boot sudo.extraConfig = '' @@ -128,6 +146,7 @@ in { ''; rtkit.enable = true; }; + sound.enable = false; services.pipewire = { enable = true; @@ -149,11 +168,13 @@ in { support32Bit = true; }; }; + fonts = { enableDefaultFonts = true; fontconfig.enable = true; fonts = [pkgs.dejavu_fonts]; }; + environment = { systemPackages = [btrfsDiff]; pathsToLink = ["/share/zsh"]; @@ -172,45 +193,23 @@ in { "${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json:${pkgs.driversi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json"; }; }; + networking.interfaces.enp6s0.useDHCP = true; services = { - code-server = { - enable = false; - auth = "none"; - user = "patriot"; - group = "users"; - }; + earlyoom.enable = true; ipfs = { enable = false; enableGC = true; autoMount = true; }; flatpak.enable = false; - xserver = {videoDrivers = ["amdgpu"];}; - postgresql = { - enable = false; - enableTCPIP = true; - authentication = - lib.mkOverride - 10 - '' - local all all trust - host all all 0.0.0.0/0 md5 - ''; - settings = {listen_addresses = "*";}; - initialScript = - pkgs.writeText - "backend-initScript" - '' - CREATE ROLE patriot WITH LOGIN PASSWORD 'patriot' CREATEDB; - CREATE DATABASE harmony; - GRANT ALL PRIVILEGES ON DATABASE harmony TO patriot; - ''; - }; + xserver.videoDrivers = ["amdgpu"]; }; + virtualisation = { podman.enable = true; libvirtd.enable = false; }; + system.stateVersion = "20.09"; } diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..e58ecbf --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,10 @@ +lib: +(lib.extend (_: _: builtins)).extend (_: lib: rec { + defaultSystems = import ./systems.nix; + genSystems = lib.genAttrs defaultSystems; + + pkgBin = pkgs: id: + if lib.isString id + then "${pkgs.${id}}/bin/${id}" + else "${pkgs.${id.name}}/bin/${id.bin}"; +}) diff --git a/lib/systems.nix b/lib/systems.nix new file mode 100644 index 0000000..4db535b --- /dev/null +++ b/lib/systems.nix @@ -0,0 +1 @@ +["x86_64-linux"] diff --git a/profiles/default.nix b/modules/base/default.nix similarity index 80% rename from profiles/default.nix rename to modules/base/default.nix index bb9d6c0..18e53c0 100644 --- a/profiles/default.nix +++ b/modules/base/default.nix @@ -2,18 +2,19 @@ inputs, config, pkgs, + lib, ... }: let - inherit (pkgs) lib; inherit (lib) fileContents mkIf pkgBin; + coreBin = v: "${pkgs.coreutils}/bin/${v}"; nixBin = "${config.nix.package}/bin/nix"; in { - imports = [./cachix]; - boot = { - tmpOnTmpfs = true; - loader.systemd-boot.configurationLimit = 10; - }; + imports = [ + ./nix.nix + ./hm-system-defaults.nix + ]; + console.font = "7x14"; environment = { systemPackages = with pkgs; [ @@ -139,38 +140,6 @@ in { --experimental-features 'nix-command' \ diff-closures /run/current-system "$systemConfig" ''; - nix = let - registry = - builtins.removeAttrs - (builtins.mapAttrs (_: v: {flake = v;}) (lib.filterAttrs (_: v: v ? outputs) inputs)) - ["bud"]; - in { - package = pkgs.nixUnstable; - gc.automatic = true; - optimise.automatic = true; - extraOptions = '' - min-free = 536870912 - keep-outputs = true - keep-derivations = true - fallback = true - ''; - inherit registry; - settings = { - sandbox = true; - allowed-users = ["@wheel"]; - trusted-users = ["root" "@wheel"]; - auto-optimise-store = true; - }; - }; - programs.command-not-found.enable = false; - home-manager.useGlobalPkgs = true; users.mutableUsers = false; - # For rage encryption, all hosts need a ssh key pair - /* - services.openssh = { - enable = true; - openFirewall = lib.mkDefault false; - }; - */ - services.earlyoom.enable = true; + programs.command-not-found.enable = false; } diff --git a/modules/hm-system-defaults.nix b/modules/base/hm-system-defaults.nix similarity index 87% rename from modules/hm-system-defaults.nix rename to modules/base/hm-system-defaults.nix index 4884728..bd90f37 100644 --- a/modules/hm-system-defaults.nix +++ b/modules/base/hm-system-defaults.nix @@ -1,4 +1,5 @@ {config, ...}: { + home-manager.useGlobalPkgs = true; home-manager.sharedModules = [ { home.sessionVariables = {inherit (config.environment.sessionVariables) NIX_PATH;}; diff --git a/modules/base/nix.nix b/modules/base/nix.nix new file mode 100644 index 0000000..eee3d80 --- /dev/null +++ b/modules/base/nix.nix @@ -0,0 +1,23 @@ +{ + pkgs, + lib, + inputs, + ... +}: { + nix = { + registry = builtins.mapAttrs (_: v: {flake = v;}) (lib.filterAttrs (_: v: v ? outputs) inputs); + package = pkgs.nixUnstable; + gc.automatic = true; + optimise.automatic = true; + extraOptions = '' + min-free = 536870912 + keep-outputs = true + keep-derivations = true + fallback = true + ''; + useSandbox = true; + allowedUsers = ["@wheel"]; + trustedUsers = ["root" "@wheel"]; + autoOptimiseStore = true; + }; +} diff --git a/profiles/cachix/default.nix b/modules/cachix/default.nix similarity index 84% rename from profiles/cachix/default.nix rename to modules/cachix/default.nix index 24bcfd1..5d7dc62 100644 --- a/profiles/cachix/default.nix +++ b/modules/cachix/default.nix @@ -9,5 +9,5 @@ imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); in { #inherit imports; - nix.settings.substituters = ["https://cache.nixos.org/"]; + nix.binaryCaches = ["https://cache.nixos.org/"]; } diff --git a/profiles/cachix/harmony.nix b/modules/cachix/harmony.nix similarity index 100% rename from profiles/cachix/harmony.nix rename to modules/cachix/harmony.nix diff --git a/profiles/cachix/nix-cargo-integration.nix b/modules/cachix/nix-cargo-integration.nix similarity index 100% rename from profiles/cachix/nix-cargo-integration.nix rename to modules/cachix/nix-cargo-integration.nix diff --git a/profiles/cachix/nix-community.nix b/modules/cachix/nix-community.nix similarity index 100% rename from profiles/cachix/nix-community.nix rename to modules/cachix/nix-community.nix diff --git a/profiles/cachix/nixpkgs-wayland.nix b/modules/cachix/nixpkgs-wayland.nix similarity index 100% rename from profiles/cachix/nixpkgs-wayland.nix rename to modules/cachix/nixpkgs-wayland.nix diff --git a/profiles/cachix/nrdxp.nix b/modules/cachix/nrdxp.nix similarity index 100% rename from profiles/cachix/nrdxp.nix rename to modules/cachix/nrdxp.nix diff --git a/profiles/cachix/veloren-nix.nix b/modules/cachix/veloren-nix.nix similarity index 100% rename from profiles/cachix/veloren-nix.nix rename to modules/cachix/veloren-nix.nix diff --git a/modules/default.nix b/modules/default.nix index f93928d..1785c5c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,5 +1,7 @@ { imports = [ - ./hm-system-defaults.nix + ./base + ./develop + ./cachix ]; } diff --git a/profiles/develop/default.nix b/modules/develop/default.nix similarity index 100% rename from profiles/develop/default.nix rename to modules/develop/default.nix diff --git a/profiles/develop/editor/default.nix b/modules/develop/editor/default.nix similarity index 100% rename from profiles/develop/editor/default.nix rename to modules/develop/editor/default.nix diff --git a/profiles/develop/editor/helix.nix b/modules/develop/editor/helix.nix similarity index 100% rename from profiles/develop/editor/helix.nix rename to modules/develop/editor/helix.nix diff --git a/profiles/develop/editor/kakoune.nix b/modules/develop/editor/kakoune.nix similarity index 100% rename from profiles/develop/editor/kakoune.nix rename to modules/develop/editor/kakoune.nix diff --git a/profiles/develop/godot.nix b/modules/develop/godot.nix similarity index 100% rename from profiles/develop/godot.nix rename to modules/develop/godot.nix diff --git a/profiles/network/default.nix b/modules/network/default.nix similarity index 100% rename from profiles/network/default.nix rename to modules/network/default.nix diff --git a/profiles/network/dns/default.nix b/modules/network/dns/default.nix similarity index 100% rename from profiles/network/dns/default.nix rename to modules/network/dns/default.nix diff --git a/profiles/network/dns/nextdns.nix b/modules/network/dns/nextdns.nix similarity index 100% rename from profiles/network/dns/nextdns.nix rename to modules/network/dns/nextdns.nix diff --git a/profiles/network/dns/stubby/default.nix b/modules/network/dns/stubby/default.nix similarity index 100% rename from profiles/network/dns/stubby/default.nix rename to modules/network/dns/stubby/default.nix diff --git a/profiles/network/dns/stubby/nextdns.nix b/modules/network/dns/stubby/nextdns.nix similarity index 100% rename from profiles/network/dns/stubby/nextdns.nix rename to modules/network/dns/stubby/nextdns.nix diff --git a/profiles/network/iwd.nix b/modules/network/iwd.nix similarity index 100% rename from profiles/network/iwd.nix rename to modules/network/iwd.nix diff --git a/profiles/network/networkmanager/default.nix b/modules/network/networkmanager/default.nix similarity index 100% rename from profiles/network/networkmanager/default.nix rename to modules/network/networkmanager/default.nix diff --git a/profiles/network/ssh.nix b/modules/network/ssh.nix similarity index 100% rename from profiles/network/ssh.nix rename to modules/network/ssh.nix diff --git a/profiles/network/wpa_supplicant.nix b/modules/network/wpa_supplicant.nix similarity index 100% rename from profiles/network/wpa_supplicant.nix rename to modules/network/wpa_supplicant.nix diff --git a/pkgs-set/default.nix b/pkgs-set/default.nix new file mode 100644 index 0000000..4e8b95a --- /dev/null +++ b/pkgs-set/default.nix @@ -0,0 +1,19 @@ +{ + stable, + unstable, + system, + lib, +}: let + overlays = + lib.mapAttrsToList + (name: _: import "${./overlays}/${name}") + (lib.readDir ./overlays); + unstablePkgs = import unstable { + inherit system; + }; + pkgs = import stable { + inherit system; + overlays = [(_: _: import ./from-unstable.nix unstablePkgs)] ++ overlays; + }; +in + pkgs diff --git a/pkgs-set/from-unstable.nix b/pkgs-set/from-unstable.nix new file mode 100644 index 0000000..77662fd --- /dev/null +++ b/pkgs-set/from-unstable.nix @@ -0,0 +1,9 @@ +pkgs: { + inherit + (pkgs) + helix + alejandra + rnix-lsp + chromium + ; +} diff --git a/overlays/chromium-wayland.nix b/pkgs-set/overlays/chromium-wayland.nix similarity index 100% rename from overlays/chromium-wayland.nix rename to pkgs-set/overlays/chromium-wayland.nix diff --git a/overlays/discord-canary-system.nix b/pkgs-set/overlays/discord-canary-system.nix similarity index 100% rename from overlays/discord-canary-system.nix rename to pkgs-set/overlays/discord-canary-system.nix diff --git a/overlays/discord-canary.nix b/pkgs-set/overlays/discord-canary.nix similarity index 100% rename from overlays/discord-canary.nix rename to pkgs-set/overlays/discord-canary.nix diff --git a/overlays/phantom.nix b/pkgs-set/overlays/phantom.nix similarity index 100% rename from overlays/phantom.nix rename to pkgs-set/overlays/phantom.nix diff --git a/overlays/vscode-wayland.nix b/pkgs-set/overlays/vscode-wayland.nix similarity index 100% rename from overlays/vscode-wayland.nix rename to pkgs-set/overlays/vscode-wayland.nix diff --git a/shells/default.nix b/shells/default.nix new file mode 100644 index 0000000..c8ce569 --- /dev/null +++ b/shells/default.nix @@ -0,0 +1,9 @@ +{lib, ...}: +lib.genPkgs (pkgs: { + default = with pkgs; + mkShell { + name = "prts"; + buildInputs = [git git-crypt]; + shellHook = "echo welcome to PRTS, $USER"; + }; +}) diff --git a/users/profiles/direnv/default.nix b/users/modules/direnv/default.nix similarity index 100% rename from users/profiles/direnv/default.nix rename to users/modules/direnv/default.nix diff --git a/users/profiles/git/default.nix b/users/modules/git/default.nix similarity index 100% rename from users/profiles/git/default.nix rename to users/modules/git/default.nix diff --git a/users/profiles/hikari/default.nix b/users/modules/hikari/default.nix similarity index 100% rename from users/profiles/hikari/default.nix rename to users/modules/hikari/default.nix diff --git a/users/profiles/starship/default.nix b/users/modules/starship/default.nix similarity index 100% rename from users/profiles/starship/default.nix rename to users/modules/starship/default.nix diff --git a/users/profiles/wtf/default.nix b/users/modules/wtf/default.nix similarity index 100% rename from users/profiles/wtf/default.nix rename to users/modules/wtf/default.nix diff --git a/users/patriot/default.nix b/users/patriot/default.nix index eace970..b637856 100644 --- a/users/patriot/default.nix +++ b/users/patriot/default.nix @@ -1,13 +1,13 @@ { - config, pkgs, lib, ... -}: let +} @ globalAttrs: let inherit (lib) mapAttrs' nameValuePair; inherit (builtins) readDir fetchGit; - pkgBin = lib.our.pkgBinNoDep pkgs; - nixosConfig = config; + + pkgBin = lib.pkgBin pkgs; + nixosConfig = globalAttrs.config; in { users.users.patriot = { isNormalUser = true; @@ -234,9 +234,9 @@ in { ''; in { imports = [ - ../profiles/direnv - ../profiles/git - ../profiles/starship + ../modules/direnv + ../modules/git + ../modules/starship ]; fonts.fontconfig.enable = true; home = {