mirror of
https://github.com/callumio/nixfiles.git
synced 2025-12-17 03:29:20 +00:00
finally on flake parts
just need to remove fup now
This commit is contained in:
parent
3b4057b366
commit
fdafb67215
20 changed files with 206 additions and 123 deletions
116
flake.nix
116
flake.nix
|
|
@ -52,7 +52,6 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nur.url = "github:nix-community/NUR";
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs = {
|
||||
|
|
@ -61,73 +60,102 @@
|
|||
};
|
||||
};
|
||||
flake-compat.url = "github:edolstra/flake-compat";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
# systems.url = "github:nix-systems/default";
|
||||
# systems.url = "github:nix-systems/default-linux";
|
||||
systems.url = "github:nix-systems/x86_64-linux";
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
disko,
|
||||
nixpkgs,
|
||||
flake-parts,
|
||||
nixinate,
|
||||
utils,
|
||||
nur,
|
||||
home-manager,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (utils.lib) mkApp;
|
||||
mods = import ./modules {inherit utils;};
|
||||
hosts = import ./hosts {inherit inputs utils;};
|
||||
#_nixosConfigurations = import ./hosts {inherit inputs utils mods self;};
|
||||
overlay = import ./overlays {inherit inputs;};
|
||||
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
|
||||
with mods.nixosModules;
|
||||
utils.lib.mkFlake {
|
||||
inherit self inputs;
|
||||
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;
|
||||
inherit (hosts) hosts;
|
||||
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
||||
channelsConfig.allowUnfree = true;
|
||||
channelsConfig.allowBroken = false;
|
||||
nixosConfigurations = {
|
||||
artemis = mkLinuxSystem ./hosts/artemis;
|
||||
hermes = mkLinuxSystem ./hosts/hermes;
|
||||
};
|
||||
#nixosConfigurations.artemis = inputs.nixpkgs.lib.nixosSystem {};
|
||||
};
|
||||
|
||||
channels.nixpkgs.overlaysBuilder = channels: [
|
||||
(final: prev: {
|
||||
inherit (channels) unstable;
|
||||
})
|
||||
];
|
||||
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};};
|
||||
|
||||
channels.unstable.overlaysBuilder = channels: [
|
||||
(final: prev: {
|
||||
jellyfin-ffmpeg = prev.jellyfin-ffmpeg.override {
|
||||
ffmpeg_6-full = prev.ffmpeg_6-full.override {
|
||||
withMfx = false;
|
||||
withVpl = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
pre-commit.check.enable = false;
|
||||
pre-commit.settings.hooks.alejandra.enable = true;
|
||||
|
||||
sharedOverlays = [
|
||||
overlay
|
||||
nur.overlay
|
||||
];
|
||||
|
||||
hostDefaults.modules = [home-manager.nixosModules.home-manager inputs.stylix.nixosModules.stylix inputs.agenix.nixosModules.default] ++ mods.sharedModules;
|
||||
|
||||
hostDefaults.extraArgs = {
|
||||
inherit inputs;
|
||||
treefmt.config = {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.alejandra.enable = true;
|
||||
};
|
||||
|
||||
outputsBuilder = channels:
|
||||
with channels.nixpkgs; {
|
||||
defaultPackage = nixvim;
|
||||
packages = utils.lib.exportPackages self.overlays channels;
|
||||
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];
|
||||
};
|
||||
|
||||
formatter = alejandra;
|
||||
devShell = mkShell {
|
||||
packages = [just git nixvim cachix jq devour-flake agenix];
|
||||
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;
|
||||
};
|
||||
};
|
||||
overlays = utils.lib.exportOverlays {
|
||||
inherit (self) pkgs inputs;
|
||||
};
|
||||
apps.x86_64-linux = (nixinate.nixinate.x86_64-linux self).nixinate;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue