aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-28 17:27:39 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-28 17:27:39 +0100
commit3c48cde7f249d354dbba6235d8d70ff4e4eb3293 (patch)
tree4e772782b77d41c33c0152437db78a615b16c217 /flake.nix
parent{flake,hosts/default}: Use deploy-rs again (diff)
downloadnixos-server-3c48cde7f249d354dbba6235d8d70ff4e4eb3293.zip
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.
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix119
1 files changed, 15 insertions, 104 deletions
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};