remove fup

This commit is contained in:
Callum Leslie 2024-09-05 10:37:59 +01:00 committed by Callum Leslie
parent 940ffd857b
commit 152ce6cfd2
4 changed files with 108 additions and 148 deletions

54
flake.lock generated
View file

@ -429,24 +429,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"fromYaml": { "fromYaml": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -984,8 +966,7 @@
"stylix": "stylix", "stylix": "stylix",
"systems": "systems_4", "systems": "systems_4",
"treefmt-nix": "treefmt-nix_2", "treefmt-nix": "treefmt-nix_2",
"unstable": "unstable", "unstable": "unstable"
"utils": "utils"
} }
}, },
"stylix": { "stylix": {
@ -1082,21 +1063,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -1152,24 +1118,6 @@
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
},
"utils": {
"inputs": {
"flake-utils": "flake-utils_4"
},
"locked": {
"lastModified": 1722363685,
"narHash": "sha256-XCf2PIAT6lH7BwytgioPmVf/wkzXjSKScC4KzcZgb64=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "6b10f51ff73a66bb29f3bc8151a59d217713f496",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

179
flake.nix
View file

@ -1,6 +1,91 @@
{ {
description = "C's Nix-Config"; description = "C's Nix-Config";
outputs = {
self,
nixpkgs,
flake-parts,
...
} @ inputs: let
mods = import ./modules;
mkLinuxSystem = mod:
nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules =
[
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
inputs.agenix.nixosModules.default
{
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [self.overlays.default];
}
mod
]
++ mods.sharedModules;
};
in
flake-parts.lib.mkFlake {inherit self inputs;} {
imports = [
inputs.flake-parts.flakeModules.easyOverlay
inputs.pre-commit-hooks.flakeModule
inputs.treefmt-nix.flakeModule
];
systems = import inputs.systems;
flake = {
inherit (mods) homeManagerModules nixosModules;
# TODO: use ./hosts/
nixosConfigurations = {
artemis = mkLinuxSystem ./hosts/artemis;
hermes = mkLinuxSystem ./hosts/hermes;
};
};
perSystem = {
config,
pkgs,
final,
system,
inputs',
#self',
...
}: {
_module.args.pkgs = inputs'.nixpkgs.legacyPackages.extend self.overlays.default;
overlayAttrs = config.packages // {unstable = inputs.unstable.legacyPackages.${system};};
pre-commit.check.enable = false;
pre-commit.settings.hooks.alejandra.enable = true;
treefmt.config = {
projectRootFile = "flake.nix";
programs.alejandra.enable = true;
};
devShells.default = final.mkShell {
meta.description = "Default dev shell";
inputsFrom = [config.pre-commit.devShell config.treefmt.build.devShell];
packages = with final; [just git nixvim cachix jq devour-flake agenix deadnix];
};
apps = nixpkgs.lib.mapAttrs' (name: value: nixpkgs.lib.nameValuePair ("deploy-" + name) value) (inputs.nixinate.nixinate.${system} self).nixinate;
packages = {
nixvim = inputs.nixvim.packages.${system}.default;
agenix = inputs.agenix.packages.${system}.default;
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
devour-flake = pkgs.callPackage inputs.devour-flake {};
jellyfin-ffmpeg = pkgs.jellyfin-ffmpeg.override {
ffmpeg_6-full = pkgs.ffmpeg_6-full.override {
withMfx = false;
withVpl = true;
};
};
};
};
};
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
@ -28,8 +113,6 @@
inputs.darwin.follows = ""; inputs.darwin.follows = "";
}; };
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.05"; url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -59,100 +142,14 @@
flake-compat.follows = "flake-compat"; flake-compat.follows = "flake-compat";
}; };
}; };
flake-compat.url = "github:edolstra/flake-compat"; flake-compat.url = "github:edolstra/flake-compat";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
#systems.url = "github:nix-systems/default-linux"; #systems.url = "github:nix-systems/default-linux";
#systems.url = "github:nix-systems/x86_64-linux"; #systems.url = "github:nix-systems/x86_64-linux";
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
}; };
outputs = {
self,
disko,
nixpkgs,
flake-parts,
nixinate,
utils,
home-manager,
...
} @ inputs: let
mods = import ./modules {inherit utils;};
mkLinuxSystem = mod:
nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules =
[
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
inputs.agenix.nixosModules.default
{
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [self.overlays.default];
}
mod
]
++ mods.sharedModules;
};
in
flake-parts.lib.mkFlake {inherit self inputs;} {
imports = [
inputs.flake-parts.flakeModules.easyOverlay
inputs.pre-commit-hooks.flakeModule
inputs.treefmt-nix.flakeModule
];
systems = import inputs.systems;
flake = {
inherit (mods) homeManagerModules nixosModules;
nixosConfigurations = {
artemis = mkLinuxSystem ./hosts/artemis;
hermes = mkLinuxSystem ./hosts/hermes;
};
#nixosConfigurations.artemis = inputs.nixpkgs.lib.nixosSystem {};
};
perSystem = {
config,
pkgs,
final,
system,
inputs',
self',
...
}: {
_module.args.pkgs = inputs'.nixpkgs.legacyPackages.extend self.overlays.default;
overlayAttrs = config.packages // {unstable = inputs.unstable.legacyPackages.${system};};
pre-commit.check.enable = false;
pre-commit.settings.hooks.alejandra.enable = true;
treefmt.config = {
projectRootFile = "flake.nix";
programs.alejandra.enable = true;
};
devShells.default = final.mkShell {
meta.description = "Default dev shell";
inputsFrom = [config.pre-commit.devShell config.treefmt.build.devShell];
packages = with final; [just git nixvim cachix jq devour-flake agenix deadnix];
};
apps = nixpkgs.lib.mapAttrs' (name: value: nixpkgs.lib.nameValuePair ("deploy-" + name) value) (nixinate.nixinate.${system} self).nixinate;
packages = {
nixvim = inputs.nixvim.packages.${system}.default;
agenix = inputs.agenix.packages.${system}.default;
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
devour-flake = pkgs.callPackage inputs.devour-flake {};
jellyfin-ffmpeg = pkgs.jellyfin-ffmpeg.override {
ffmpeg_6-full = pkgs.ffmpeg_6-full.override {
withMfx = false;
withVpl = true;
};
};
};
};
};
} }

View file

@ -1,6 +1,5 @@
{ {
inputs, inputs,
utils,
mods, mods,
self, self,
... ...

View file

@ -1,5 +1,21 @@
{utils, ...}: let let
nixosModules = utils.lib.exportModules [ exportModules = args:
builtins.listToAttrs (map (arg: {
name = let
str = baseNameOf arg;
suffix = ".nix";
sufLen = builtins.stringLength suffix;
sLen = builtins.stringLength str;
in
if sufLen <= sLen && suffix == builtins.substring (sLen - sufLen) sufLen str
then builtins.substring 0 (sLen - sufLen) str
else str;
value = import arg;
})
args);
nixosModules = exportModules [
./nix.nix ./nix.nix
./pinentry-fix.nix ./pinentry-fix.nix
./hm.nix ./hm.nix
@ -9,7 +25,7 @@
./tailscale.nix ./tailscale.nix
./secret.nix ./secret.nix
]; ];
homeManagerModules = utils.lib.exportModules [ homeManagerModules = exportModules [
./trayscale.nix ./trayscale.nix
]; ];
sharedModules = with nixosModules; [ sharedModules = with nixosModules; [