{ description = "nixfiles"; # `flake.lock` generation is not computable[1], thus it is impossible to add # helper functions to manage inputs. # # [1]: https://github.com/NixOS/nix/issues/5373 inputs = { nixpkgs = { type = "github"; owner = "NixOS"; repo = "nixpkgs"; ref = "nixpkgs-unstable"; }; nixpkgs-master = { type = "github"; owner = "NixOS"; repo = "nixpkgs"; ref = "master"; }; nixpkgs-stable = { type = "github"; owner = "NixOS"; repo = "nixpkgs"; ref = "release-22.05"; }; # For testing PRs and stuff. # nixpkgs-local = { # type = "path"; # path = "/home/azahi/src/nixpkgs"; # }; nixos-hardware = { type = "github"; owner = "NixOS"; repo = "nixos-hardware"; ref = "master"; }; nur = { type = "github"; owner = "nix-community"; repo = "NUR"; ref = "master"; }; home-manager = { type = "github"; owner = "nix-community"; repo = "home-manager"; ref = "master"; inputs = { nixpkgs.follows = "nixpkgs"; utils.follows = "flake-utils"; }; }; emacs-overlay = { type = "github"; owner = "nix-community"; repo = "emacs-overlay"; ref = "master"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; arkenfox-nixos = { type = "github"; owner = "dwarfmaster"; repo = "arkenfox-nixos"; ref = "main"; inputs.nixpkgs.follows = "nixpkgs"; }; nix-doom-emacs = { type = "github"; owner = "nix-community"; repo = "nix-doom-emacs"; ref = "master"; inputs = { emacs-overlay.follows = "emacs-overlay"; flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; # nil = { # type = "github"; # owner = "oxalica"; # repo = "nil"; # ref = "main"; # inputs = { # flake-utils.follows = "flake-utils"; # nixpkgs.follows = "nixpkgs"; # }; # }; # nix-minecraft-servers = { # type = "github"; # owner = "jyooru"; # repo = "nix-minecraft-servers"; # ref = "main"; # inputs = { # nixpkgs.follows = "nixpkgs"; # utils.inputs.flake-utils.follows = "flake-utils"; # }; # }; # pollymc = { # type = "github"; # owner = "fn2006"; # repo = "PollyMC"; # ref = "5.2"; # inputs = { # flake-compat.follows = "flake-compat"; # nixpkgs.follows = "nixpkgs"; # }; # }; dns-nix = { type = "github"; owner = "kirelagin"; repo = "dns.nix"; ref = "master"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; simple-nixos-mailserver = { type = "gitlab"; owner = "simple-nixos-mailserver"; repo = "nixos-mailserver"; ref = "master"; inputs = { nixpkgs-22_05.follows = "nixpkgs-stable"; nixpkgs.follows = "nixpkgs"; utils.follows = "flake-utils"; }; }; # TODO Integrate into Altertmanager. # alertmanager-gotify = { # type = "git"; # url = "https://git.mbosch.me/ma27/alertmanager-gotify"; # inputs = { # flake-utils.follows = "flake-utils"; # nixpkgs.follows = "nixpkgs"; # }; # }; flake-utils = { type = "github"; owner = "numtide"; repo = "flake-utils"; ref = "master"; }; flake-registry = { type = "github"; owner = "NixOS"; repo = "flake-registry"; ref = "master"; flake = false; }; agenix = { type = "github"; owner = "ryantm"; repo = "agenix"; ref = "main"; inputs.nixpkgs.follows = "nixpkgs"; }; pre-commit-hooks = { type = "github"; owner = "cachix"; repo = "pre-commit-hooks.nix"; ref = "master"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; xmonad-ng = { # type = "path"; # path = "/home/azahi/src/xmonad-ng"; url = "git+https://git.azahi.cc/xmonad-ng?ref=master"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; azahi-cc = { url = "git+https://git.azahi.cc/azahi-cc?ref=master"; flake = false; }; nmap-vulners = { type = "github"; owner = "vulnersCom"; repo = "nmap-vulners"; ref = "master"; flake = false; }; nmap-vulscan = { type = "github"; owner = "scipag"; repo = "vulscan"; ref = "master"; flake = false; }; # NOTE These inputs are used indirectly. They are declared explicitly here # because nested follows is not yet release in a stable version of nix[1]. # # [1]: https://github.com/NixOS/nix/issues/5790 # [1]: https://github.com/NixOS/nix/pull/6621 # flake-utils-plus = { # type = "github"; # owner = "gytis-ivaskevicius"; # repo = "flake-utils-plus"; # ref = "master"; # inputs.flake-utils.follows = "flake-utils"; # }; # flake-compat = { # type = "github"; # owner = "edolstra"; # repo = "flake-compat"; # ref = "master"; # flake = false; # }; }; outputs = inputs: with inputs; let lib = nixpkgs.lib.extend (import ./lib); in flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-linux"] (system: let pkgs = import nixpkgs { inherit system; overlays = [self.overlays.default]; }; in { packages.default = pkgs.nixfiles; apps.${system}.default = { type = "app"; package = "${self.packages.${system}.nixfiles}/bin/nixfiles"; }; devShells.default = pkgs.mkShell { inherit (self.checks.${system}.preCommit) shellHook; }; # This interface is very primitive... formatter = pkgs.writeShellApplication { name = "fmt"; runtimeInputs = with pkgs; [alejandra]; text = '' alejandra --quiet "$@" ''; }; checks.preCommit = pre-commit-hooks.lib.${system}.run { src = ./.; hooks = { alejandra.enable = true; prettier = { enable = true; types = []; files = "\\.css"; }; shellcheck.enable = true; shfmt.enable = true; statix.enable = true; }; }; }) // { inherit lib; nixosModules.nixfiles = import ./modules/nixfiles; nixosConfigurations = import ./configurations {inherit inputs lib;}; # TODO Make it so that self.packages also can use this. overlays.default = final: _: { bruh = final.callPackage ./packages/bruh.nix {}; mpv-autosub = final.callPackage ./packages/mpv-autosub.nix {}; myip = final.callPackage ./packages/myip.nix {}; nixfiles = final.callPackage ./packages/nixfiles.nix {}; throttled = final.callPackage ./packages/throttled.nix {}; }; }; }