Migrate from flake-utils to flake-parts

This commit is contained in:
Erwin Boskma 2023-05-21 22:14:04 +02:00
parent f32c4e1ac0
commit 349f8cdb87
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg

View file

@ -11,6 +11,10 @@
flake-utils.url = "github:numtide/flake-utils";
flake-parts = {
url = "github:hercules-ci/flake-parts";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
pre-commit-hooks = {
@ -97,6 +101,7 @@
, ha-now-playing
, pamedia
, nixinate
, flake-parts
, ...
} @ inputs:
with inputs; let
@ -137,7 +142,19 @@
super.makeModulesClosure (x // { allowMissing = true; });
});
config.allowUnfree = true;
config = {
permittedInsecurePackages = [
# *Exceptionally*, those packages will be cached with their *secure* dependents
# because they will reach EOL in the middle of the 23.05 release
# and it will be too much painful for our users to recompile them
# for no real reason.
# Remove them for 23.11.
"nodejs-16.20.0"
"openssl-1.1.1t"
];
allowUnfree = true;
};
};
}
@ -155,15 +172,16 @@
;
};
in
{
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
flake = {
overlays.default = import ./overlays;
# overlay = final: prev: {
# unstable = import nixpkgs {
# system = "x86_64-linux";
# config.allowUnfree = true;
# };
# };
nixosModules = builtins.listToAttrs (map
(x: {
@ -186,32 +204,33 @@
(builtins.attrNames machines));
apps = nixinate.nixinate.x86_64-linux self;
}
// (flake-utils.lib.eachSystem [ "x86_64-linux" ])
(
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
ha-now-playing.overlays.${system}
pamedia.overlays.${system}
];
config = {
allowUnsupportedSystem = true;
allowUnfree = true;
};
};
# pkgs = nixpkgs.legacyPackages.${system};
in
perSystem = { self', pkgs, system, lib, ... }:
# let
# pkgs = import nixpkgs {
# inherit system;
# overlays = [
# self.overlays.default
# ha-now-playing.overlays.${system}
# pamedia.overlays.${system}
# ];
# config = {
# allowUnsupportedSystem = true;
# allowUnfree = true;
# };
# };
# # pkgs = nixpkgs.legacyPackages.${system};
# in
{
packages = flake-utils.lib.flattenTree {
packages = {
rofi-wayland = pkgs.rofi-wayland;
nix-plugins = pkgs.nix-plugins;
backscrub = pkgs.backscrub;
bl3auto = pkgs.bl3auto;
commitgpt = pkgs.commitgpt;
obs-backgroundremoval = pkgs.obs-backgroundremoval;
};
@ -235,13 +254,13 @@
devShells.default = with pkgs;
mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
inherit (self'.checks.pre-commit-check) shellHook;
name = "dotfiles";
packages = [
pkgs.sops
ssh-to-age
age
nodejs-18_x
nodejs
nodePackages.typescript-language-server
nodePackages.yaml-language-server
nodePackages.vscode-css-languageserver-bin
@ -251,6 +270,8 @@
nix-prefetch-scripts
nix-prefetch-github
nix-prefetch-docker
nix-top
nix-tree
popsicle
terraform
terraform-ls
@ -271,6 +292,6 @@
};
formatter = pkgs.nixpkgs-fmt;
}
);
};
};
}