From 3c48cde7f249d354dbba6235d8d70ff4e4eb3293 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 28 Oct 2026 17:27:39 +0100 Subject: flake: Switch inputs over to unflake [`unflake`](https://codeberg.org/goldstein/unflake) allows prefect input de-dedulication and also gives us in general more control over which inputs exist and where they are fetched from. --- flake.nix | 119 ++++++++------------------------------------------------------ 1 file changed, 15 insertions(+), 104 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 8a51e87..23e773f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,115 +1,26 @@ { description = "NixOS server config"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05-small"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small"; + inputs = {}; - deploy-rs.url = "github:serokell/deploy-rs"; - - home-manager = { - url = "github:nix-community/home-manager/release-26.05"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - - library.url = "git+https://git.foss-syndicate.org/vhack.eu/nix-library?ref=prime"; - - treefmt-nix = { - url = "github:numtide/treefmt-nix"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - - # inputs for following - systems = { - url = "github:nix-systems/x86_64-linux"; # only evaluate for this system - }; - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; - crane = { - url = "github:ipetkov/crane"; - inputs = {}; - }; - flake-utils = { - url = "github:numtide/flake-utils"; - inputs = { - systems.follows = "systems"; - }; - }; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; + outputs = {self, ...} @ attrs: let + sources = import ./unflake.nix; + inherit (sources) nixpkgs; + inherit (sources) nixpkgs-unstable; + inherit (sources) library; + inherit (sources) treefmt-nix; + inherit (sources) deploy-rs; # modules - agenix = { - url = "github:ryantm/agenix"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - turtle = { - url = "git+https://git.foss-syndicate.org/bpeetz/forks/atuin?ref=main"; - inputs = { - crane.follows = "crane"; - nixpkgs.follows = "nixpkgs"; - }; - }; - disko = { - url = "github:nix-community/disko"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - impermanence = { - url = "github:nix-community/impermanence"; - inputs = { - nixpkgs.follows = "nixpkgs"; - home-manager.follows = "home-manager"; - }; - }; - rocie = { - url = "git+https://git.foss-syndicate.org/bpeetz/rocie/nix?ref=prime"; - inputs = { - nixpkgs.follows = "nixpkgs"; - treefmt-nix.follows = "treefmt-nix"; - crane.follows = "crane"; - rust-overlay.follows = "rust-overlay"; - }; - }; - simple-nixos-mailserver = { - url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-26.05"; - inputs = { - flake-compat.follows = "flake-compat"; - nixpkgs.follows = "nixpkgs-unstable"; - }; - }; - }; + inherit (sources) agenix; + inherit (sources) turtle; + inherit (sources) disko; + inherit (sources) impermanence; + inherit (sources) simple-nixos-mailserver; + inherit (sources) rocie; - outputs = { - self, - nixpkgs, - nixpkgs-unstable, - library, - treefmt-nix, - deploy-rs, - # modules - agenix, - turtle, - disko, - impermanence, - simple-nixos-mailserver, - rocie, - ... - } @ attrs: let system = "x86_64-linux"; + nixos-lib = import (nixpkgs + "/nixos/lib") {}; pkgs = nixpkgs.legacyPackages.${system}; pkgsUnstable = nixpkgs-unstable.legacyPackages.${system}; -- cgit v1.3.1