2021-12-06 22:35:29 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-07-14 21:05:41 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
2024-02-17 15:20:34 +00:00
|
|
|
# nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
2023-07-07 08:53:05 +00:00
|
|
|
|
2024-07-08 10:59:56 +00:00
|
|
|
# Lix
|
|
|
|
|
|
|
|
lix-module = {
|
2024-11-11 22:27:09 +00:00
|
|
|
url = "git+https://git.lix.systems/lix-project/nixos-module?ref=stable";
|
2024-07-08 10:59:56 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-07-13 14:10:44 +00:00
|
|
|
# Tools
|
|
|
|
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
|
2023-07-13 17:57:12 +00:00
|
|
|
flake-root.url = "github:srid/flake-root";
|
|
|
|
|
2024-07-23 20:03:30 +00:00
|
|
|
deploy-rs = {
|
|
|
|
url = "github:serokell/deploy-rs";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-07-13 14:10:44 +00:00
|
|
|
treefmt-nix = {
|
|
|
|
url = "github:numtide/treefmt-nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-07-25 19:31:31 +00:00
|
|
|
git-hooks = {
|
|
|
|
url = "github:cachix/git-hooks.nix";
|
2023-07-16 22:17:50 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-07-13 14:10:44 +00:00
|
|
|
# Overlays
|
|
|
|
|
2023-06-21 12:21:40 +00:00
|
|
|
disko = {
|
2024-02-18 12:41:02 +00:00
|
|
|
url = "github:nix-community/disko?ref=refs/tags/v1.3.0";
|
2024-07-14 21:05:41 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-06-21 12:21:40 +00:00
|
|
|
};
|
2021-12-06 22:35:29 +00:00
|
|
|
|
2023-07-13 10:02:14 +00:00
|
|
|
nix-darwin = {
|
2022-02-03 22:35:52 +00:00
|
|
|
url = "github:lnl7/nix-darwin";
|
2022-07-30 16:18:04 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2022-02-03 22:35:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-10 21:15:13 +00:00
|
|
|
home-manager = {
|
2024-08-13 12:36:56 +00:00
|
|
|
url = "github:nix-community/home-manager";
|
2024-07-14 21:05:41 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2021-12-10 21:15:13 +00:00
|
|
|
};
|
2021-12-06 22:35:29 +00:00
|
|
|
|
2023-06-07 18:40:27 +00:00
|
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
|
|
|
2023-04-14 08:23:54 +00:00
|
|
|
agenix = {
|
|
|
|
url = "github:ryantm/agenix";
|
2023-09-12 13:18:09 +00:00
|
|
|
inputs = {
|
2024-07-14 21:05:41 +00:00
|
|
|
nixpkgs.follows = "nixpkgs";
|
2023-09-12 13:18:09 +00:00
|
|
|
darwin.follows = "nix-darwin";
|
|
|
|
home-manager.follows = "home-manager";
|
|
|
|
};
|
2023-02-05 16:51:04 +00:00
|
|
|
};
|
|
|
|
|
2024-06-12 16:00:48 +00:00
|
|
|
neovim-nightly-overlay = {
|
|
|
|
url = "github:nix-community/neovim-nightly-overlay";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
flake-parts.follows = "flake-parts";
|
2024-07-25 19:31:31 +00:00
|
|
|
git-hooks.follows = "git-hooks";
|
2024-06-12 16:00:48 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-12-17 20:41:54 +00:00
|
|
|
nifoc-overlay = {
|
2023-09-16 16:58:14 +00:00
|
|
|
url = "git+https://git.kempkens.io/daniel/nix-overlay";
|
2023-10-02 10:18:22 +00:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
flake-parts.follows = "flake-parts";
|
|
|
|
};
|
2021-12-17 20:41:54 +00:00
|
|
|
};
|
2024-07-30 22:51:24 +00:00
|
|
|
|
|
|
|
mkalias = {
|
|
|
|
url = "github:reckenrode/mkalias";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2021-12-06 22:35:29 +00:00
|
|
|
};
|
|
|
|
|
2024-07-23 20:03:30 +00:00
|
|
|
outputs = inputs@{ flake-parts, lix-module, deploy-rs, ... }:
|
2023-07-13 14:10:44 +00:00
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
flake =
|
|
|
|
let
|
|
|
|
Styx = import ./system/flakes/Styx.nix {
|
2024-07-30 22:51:24 +00:00
|
|
|
inherit (inputs) nixpkgs home-manager nix-darwin agenix neovim-nightly-overlay mkalias nifoc-overlay;
|
2024-07-23 20:03:30 +00:00
|
|
|
inherit lix-module;
|
2023-07-13 14:10:44 +00:00
|
|
|
};
|
|
|
|
|
2024-11-08 15:16:13 +00:00
|
|
|
Pallas = import ./system/flakes/Pallas.nix {
|
|
|
|
inherit (inputs) nixpkgs home-manager nix-darwin agenix neovim-nightly-overlay mkalias nifoc-overlay;
|
|
|
|
inherit lix-module;
|
|
|
|
};
|
|
|
|
|
2023-07-13 14:10:44 +00:00
|
|
|
tanker = import ./system/flakes/tanker.nix {
|
2024-10-15 20:54:50 +00:00
|
|
|
inherit (inputs) nixpkgs disko home-manager agenix;
|
2023-07-13 14:10:44 +00:00
|
|
|
inherit inputs;
|
|
|
|
};
|
|
|
|
|
|
|
|
mediaserver = import ./system/flakes/mediaserver.nix {
|
2024-07-14 21:05:41 +00:00
|
|
|
inherit (inputs) nixpkgs home-manager agenix;
|
2024-07-23 20:03:30 +00:00
|
|
|
inherit lix-module;
|
2023-07-13 14:10:44 +00:00
|
|
|
inherit inputs;
|
|
|
|
};
|
|
|
|
|
|
|
|
argon = import ./system/flakes/argon.nix {
|
2024-07-24 07:54:07 +00:00
|
|
|
inherit (inputs) nixpkgs nixos-hardware home-manager agenix neovim-nightly-overlay nifoc-overlay;
|
|
|
|
inherit lix-module;
|
2023-07-13 14:10:44 +00:00
|
|
|
};
|
|
|
|
|
2024-03-20 23:23:44 +00:00
|
|
|
neon = import ./system/flakes/neon.nix {
|
2024-07-23 20:03:30 +00:00
|
|
|
inherit (inputs) nixpkgs nixos-hardware home-manager agenix neovim-nightly-overlay nifoc-overlay;
|
|
|
|
inherit lix-module;
|
2023-07-13 14:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
adsb-antenna = import ./system/flakes/adsb-antenna.nix {
|
2024-07-14 21:05:41 +00:00
|
|
|
inherit (inputs) nixpkgs nixos-hardware home-manager;
|
2023-07-13 14:10:44 +00:00
|
|
|
inherit inputs;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
darwinConfigurations = {
|
|
|
|
"Styx" = Styx.system;
|
2024-11-08 15:16:13 +00:00
|
|
|
"Pallas" = Pallas.system;
|
2023-07-13 14:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations = {
|
|
|
|
tanker = tanker.system;
|
|
|
|
mediaserver = mediaserver.system;
|
|
|
|
argon = argon.system;
|
2024-03-20 23:23:44 +00:00
|
|
|
neon = neon.system;
|
2023-07-13 14:10:44 +00:00
|
|
|
adsb-antenna = adsb-antenna.system;
|
|
|
|
};
|
|
|
|
|
2024-07-23 20:03:30 +00:00
|
|
|
deploy.nodes =
|
2023-10-25 13:58:11 +00:00
|
|
|
let
|
2024-11-18 16:58:39 +00:00
|
|
|
mkDeployNixOsConfig = node: node.deployment // {
|
2024-07-23 20:03:30 +00:00
|
|
|
profiles.system = {
|
|
|
|
path = deploy-rs.lib.${node.arch}.activate.nixos node.system;
|
2023-10-25 13:58:11 +00:00
|
|
|
};
|
|
|
|
};
|
2024-11-18 16:58:39 +00:00
|
|
|
|
|
|
|
# mkDeployMacOSConfig = node: node.deployment // {
|
|
|
|
# profiles.system = {
|
|
|
|
# path = deploy-rs.lib.${node.arch}.activate.darwin node.system;
|
|
|
|
# };
|
|
|
|
# };
|
2024-07-23 20:03:30 +00:00
|
|
|
in
|
|
|
|
{
|
2024-11-18 16:58:39 +00:00
|
|
|
tanker = mkDeployNixOsConfig tanker;
|
|
|
|
mediaserver = mkDeployNixOsConfig mediaserver;
|
|
|
|
argon = mkDeployNixOsConfig argon;
|
|
|
|
neon = mkDeployNixOsConfig neon;
|
|
|
|
adsb-antenna = mkDeployNixOsConfig adsb-antenna;
|
2023-10-25 13:58:11 +00:00
|
|
|
};
|
2023-07-13 14:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
imports = [
|
2023-07-13 17:57:12 +00:00
|
|
|
inputs.flake-root.flakeModule
|
2023-07-13 14:10:44 +00:00
|
|
|
inputs.treefmt-nix.flakeModule
|
2024-07-25 19:31:31 +00:00
|
|
|
inputs.git-hooks.flakeModule
|
2023-07-13 14:10:44 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
systems = [
|
|
|
|
"aarch64-darwin"
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
|
2023-07-28 23:59:23 +00:00
|
|
|
perSystem = { config, pkgs, inputs', ... }: {
|
2023-07-13 14:10:44 +00:00
|
|
|
treefmt = {
|
2024-07-03 19:24:35 +00:00
|
|
|
package = pkgs.treefmt1;
|
2023-07-13 17:57:12 +00:00
|
|
|
inherit (config.flake-root) projectRootFile;
|
2023-07-13 14:10:44 +00:00
|
|
|
|
|
|
|
programs = {
|
|
|
|
fnlfmt.enable = true;
|
|
|
|
nixpkgs-fmt.enable = true;
|
|
|
|
shfmt.enable = true;
|
2023-07-13 17:57:12 +00:00
|
|
|
yamlfmt.enable = true;
|
2023-07-13 14:10:44 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-07-16 22:17:50 +00:00
|
|
|
pre-commit = {
|
|
|
|
settings = {
|
|
|
|
hooks = {
|
|
|
|
deadnix.enable = true;
|
2023-07-16 22:41:03 +00:00
|
|
|
shellcheck.enable = true;
|
2023-09-10 15:30:22 +00:00
|
|
|
# statix.enable = true;
|
2023-07-16 22:17:50 +00:00
|
|
|
treefmt.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-07-13 14:10:44 +00:00
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
name = "dotfiles";
|
|
|
|
|
|
|
|
inputsFrom = [
|
2023-07-13 17:57:12 +00:00
|
|
|
config.flake-root.devShell
|
2023-07-13 14:10:44 +00:00
|
|
|
config.treefmt.build.devShell
|
2023-07-16 22:17:50 +00:00
|
|
|
config.pre-commit.devShell
|
2023-07-13 14:10:44 +00:00
|
|
|
];
|
2023-07-21 10:29:50 +00:00
|
|
|
|
2023-07-28 23:59:23 +00:00
|
|
|
packages = [
|
|
|
|
inputs'.agenix.packages.agenix
|
2024-07-23 20:03:30 +00:00
|
|
|
inputs'.deploy-rs.packages.default
|
2024-07-24 07:54:07 +00:00
|
|
|
pkgs.just
|
2023-10-25 13:58:11 +00:00
|
|
|
pkgs.nix-output-monitor
|
2023-07-28 23:59:23 +00:00
|
|
|
];
|
|
|
|
|
2023-07-21 10:29:50 +00:00
|
|
|
TREEFMT_CONFIG_FILE = config.treefmt.build.configFile;
|
2024-04-22 21:14:48 +00:00
|
|
|
REMOTE_REPO_TYPE = "forgejo";
|
2023-07-13 14:10:44 +00:00
|
|
|
};
|
2024-11-11 23:05:14 +00:00
|
|
|
|
|
|
|
# Used for caching (in CI) only
|
|
|
|
packages = {
|
|
|
|
deploy-rs = inputs'.deploy-rs.packages.default;
|
|
|
|
};
|
2023-05-12 15:39:09 +00:00
|
|
|
};
|
2022-08-01 20:39:14 +00:00
|
|
|
};
|
2021-12-06 22:35:29 +00:00
|
|
|
}
|