flake: get rid of flake-parts!

This commit is contained in:
Charlie Root 2024-11-01 14:51:13 +01:00
commit 2d5ee6c621
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
11 changed files with 58 additions and 127 deletions

39
flake.lock generated
View file

@ -119,24 +119,6 @@
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1727826117,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"schizofox",
@ -157,9 +139,9 @@
"type": "github"
}
},
"flake-parts_3": {
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1698882062,
@ -655,18 +637,6 @@
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1727825735,
"narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
}
},
"nixpkgs-lib_2": {
"locked": {
"dir": "lib",
"lastModified": 1698611440,
@ -794,7 +764,6 @@
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"helix": "helix",
"home-manager": "home-manager",
"hyprland": "hyprland",
@ -834,7 +803,7 @@
"schizofox": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2",
"flake-parts": "flake-parts",
"home-manager": "home-manager_2",
"nixpak": "nixpak",
"nixpkgs": [
@ -860,7 +829,7 @@
"searx-randomizer": {
"inputs": {
"crane": "crane_2",
"flake-parts": "flake-parts_3",
"flake-parts": "flake-parts_2",
"nixpkgs": [
"schizofox",
"nixpkgs"

View file

@ -2,29 +2,19 @@
description = "My NixOS config flake";
outputs = inputs: let
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
in
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
imports = [
./hosts
./parts
];
flake = {
formatter.x86_64-linux = pkgs.alejandra;
nixosModules = {
shell = import ./modules/shell;
};
};
in {
nixosConfigurations = import ./hosts inputs;
formatter.x86_64-linux = pkgs.alejandra;
devShells.x86_64-linux.default = pkgs.callPackage ./shell.nix {};
nixosModules = {
shell = import ./modules/shell;
};
};
inputs = {
# what am I doing to this config help
flake-parts.url = "github:hercules-ci/flake-parts";
# Unstable nixpkgs baby!
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
# Lix, a faster nix fork.
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";

View file

@ -1,12 +1,6 @@
{
withSystem,
inputs,
...
}: let
inputs: let
inherit (inputs) self;
inherit (self) lib;
# inherit (lib.extendedLib.builders) mkSystem;
# inherit (lib.extendedLib.modules) mkModuleTree';
inherit (inputs.nixpkgs) lib;
inherit (lib.lists) concatLists flatten singleton;
inherit (lib) mkDefault nixosSystem recursiveUpdate;
inherit (builtins) filter map toString;
@ -16,59 +10,48 @@
# to be quite a sane way of managing all modules in my flake.
mkSystem = {
withSystem,
system,
hostname,
...
} @ args:
withSystem system (
{
inputs',
self',
...
}:
nixosSystem {
nixosSystem {
inherit system;
specialArgs =
recursiveUpdate
{
inherit system;
specialArgs =
recursiveUpdate
{
inherit lib;
inherit inputs inputs';
inherit self self';
}
(args.specialArgs or {});
modules = concatLists [
# This is used to pre-emptively set the hostPlatform for nixpkgs.
# Also, we set the system hostname here.
(singleton {
networking.hostName = args.hostname;
nixpkgs.hostPlatform = mkDefault args.system;
})
(flatten (
concatLists [
(singleton ./${hostname}/default.nix)
(
filter (hasSuffix "module.nix") (
map toString (listFilesRecursive ../modules)
)
)
]
))
];
inherit lib;
inherit inputs;
inherit self;
}
);
(args.specialArgs or {});
modules = concatLists [
# This is used to pre-emptively set the hostPlatform for nixpkgs.
# Also, we set the system hostname here.
(singleton {
networking.hostName = args.hostname;
nixpkgs.hostPlatform = mkDefault args.system;
})
(flatten (
concatLists [
(singleton ./${hostname}/default.nix)
(
filter (hasSuffix "module.nix") (
map toString (listFilesRecursive ../modules)
)
)
]
))
];
};
in {
flake.nixosConfigurations = {
temperance = mkSystem {
inherit withSystem;
system = "x86_64-linux";
hostname = "temperance";
};
temperance = mkSystem {
system = "x86_64-linux";
hostname = "temperance";
};
hermit = mkSystem {
inherit withSystem;
system = "x86_64-linux";
hostname = "hermit";
};
hermit = mkSystem {
system = "x86_64-linux";
hostname = "hermit";
};
}

View file

@ -1,10 +1,4 @@
{
inputs',
pkgs,
...
}: let
inherit (inputs'.nixpkgs-stable.legacyPackages) calibre;
in {
{pkgs, ...}: {
environment.systemPackages = with pkgs;
[
alsa-utils
@ -12,6 +6,7 @@ in {
asciinema
cachix
calc
calibre
difftastic
element-desktop
evince
@ -63,6 +58,5 @@ in {
xournalpp
zapzap
zoxide
]
++ [calibre];
];
}

View file

@ -1,5 +1,4 @@
{
inputs',
config,
pkgs,
lib,

View file

@ -1,6 +1,6 @@
{
config,
inputs',
inputs,
lib,
pkgs,
...
@ -8,7 +8,7 @@
cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username;
inherit (lib) mkIf getExe;
inherit (inputs'.helix.packages) helix;
inherit (inputs.helix.packages.${pkgs.stdenv.system}) helix;
wrapped-helix = pkgs.symlinkJoin {
name = "helix-wrapped";
paths = with pkgs; [

View file

@ -1,10 +1,9 @@
{
inputs,
inputs',
pkgs,
...
}: let
spicePkgs = inputs'.spicetify-nix.legacyPackages;
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system};
in {
imports = [
inputs.spicetify-nix.nixosModules.default

View file

@ -1,6 +1,5 @@
{
config,
inputs',
lib,
pkgs,
...

View file

@ -1,6 +1,5 @@
{
config,
inputs',
lib,
pkgs,
...

View file

@ -1,11 +1,11 @@
{
config,
lib,
inputs',
inputs,
pkgs,
...
}: let
inherit (inputs') quickshell;
inherit (inputs) quickshell;
inherit (lib.generators) toKeyValue;
inherit (config.meta.mainUser) username;
in {
@ -13,7 +13,7 @@ in {
home.packages = with pkgs; [
qt6.qtimageformats # amog
qt6.qt5compat # shader fx
(quickshell.packages.default.override {
(quickshell.packages.x86_64-linux.default.override {
withJemalloc = true;
withQtSvg = true;
withX11 = true;

View file

@ -2,12 +2,11 @@
config,
pkgs,
lib,
inputs',
...
}: let
cfg = config.modules.usrEnv.desktops.hyprland;
inherit (config.meta.mainUser) username;
inherit (inputs'.hyprsplit.packages) hyprsplit;
# inherit (inputs.hyprsplit.packages.${pkgs.system}) hyprsplit;
inherit (lib) mkIf mkDefault;
in {
imports = [