2024-05-20 01:17:07 -04:00
|
|
|
{
|
|
|
|
inputs = let
|
2024-07-21 16:10:13 -04:00
|
|
|
inherit (import ./flake/inputs.nix) mkDep mkInput otherInputs;
|
2024-05-20 01:17:07 -04:00
|
|
|
|
|
|
|
mainInputs = {
|
|
|
|
nixpkgs = mkInput {
|
|
|
|
owner = "NixOS";
|
|
|
|
repo = "nixpkgs";
|
2024-06-19 19:19:25 -04:00
|
|
|
ref = "nixos-unstable";
|
2024-05-20 01:17:07 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
home-manager = mkDep {
|
2024-06-11 19:17:20 -04:00
|
|
|
owner = "nix-community";
|
2024-05-20 01:17:07 -04:00
|
|
|
repo = "home-manager";
|
|
|
|
};
|
|
|
|
|
|
|
|
nix-on-droid = mkDep {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "nix-on-droid";
|
|
|
|
|
|
|
|
inputs.home-manager.follows = "home-manager";
|
|
|
|
};
|
|
|
|
|
|
|
|
sops-nix = mkDep {
|
|
|
|
owner = "Mic92";
|
|
|
|
repo = "sops-nix";
|
|
|
|
};
|
|
|
|
|
|
|
|
secrets = mkDep {
|
|
|
|
type = "git";
|
|
|
|
url = "ssh://git@git.nelim.org/matt1432/nixos-secrets";
|
|
|
|
|
|
|
|
inputs.sops-nix.follows = "sops-nix";
|
|
|
|
};
|
2024-06-28 13:44:12 -04:00
|
|
|
|
|
|
|
jovian = mkDep {
|
|
|
|
owner = "Jovian-Experiments";
|
|
|
|
repo = "Jovian-NixOS";
|
|
|
|
};
|
2024-05-20 01:17:07 -04:00
|
|
|
};
|
|
|
|
in
|
|
|
|
mainInputs // otherInputs;
|
|
|
|
|
|
|
|
outputs = inputs @ {
|
|
|
|
nixpkgs,
|
|
|
|
secrets,
|
2024-07-14 22:59:33 -04:00
|
|
|
self,
|
2024-05-20 01:17:07 -04:00
|
|
|
...
|
|
|
|
}: let
|
2024-07-21 16:10:13 -04:00
|
|
|
inherit (import ./flake/lib.nix inputs) mkVersion mkNixOS mkNixOnDroid mkPkgs;
|
2024-05-20 22:41:45 -04:00
|
|
|
|
2024-05-20 01:17:07 -04:00
|
|
|
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
|
|
|
|
|
|
|
perSystem = attrs:
|
2024-05-20 22:41:45 -04:00
|
|
|
nixpkgs.lib.genAttrs supportedSystems (system:
|
|
|
|
attrs system (mkPkgs system nixpkgs));
|
2024-05-20 01:17:07 -04:00
|
|
|
in {
|
2024-06-27 00:56:27 -04:00
|
|
|
nixosModules = {
|
2024-07-14 19:30:28 -04:00
|
|
|
adb = import ./modules/adb.nix;
|
2024-06-27 00:56:27 -04:00
|
|
|
desktop = import ./modules/desktop;
|
|
|
|
nvidia = import ./modules/nvidia.nix;
|
2024-07-10 20:38:03 -04:00
|
|
|
plymouth = import ./modules/plymouth.nix;
|
2024-06-27 00:56:27 -04:00
|
|
|
};
|
|
|
|
|
2024-05-20 01:17:07 -04:00
|
|
|
nixosConfigurations = {
|
2024-05-20 22:41:45 -04:00
|
|
|
# Desktops
|
2024-05-20 01:17:07 -04:00
|
|
|
wim = mkNixOS [
|
|
|
|
./devices/wim
|
|
|
|
secrets.nixosModules.default
|
|
|
|
];
|
|
|
|
binto = mkNixOS [./devices/binto];
|
|
|
|
|
2024-06-29 03:45:06 -04:00
|
|
|
bbsteamie = mkNixOS [./devices/bbsteamie];
|
|
|
|
|
2024-05-20 22:41:45 -04:00
|
|
|
# NAS
|
2024-05-20 01:17:07 -04:00
|
|
|
nos = mkNixOS [
|
|
|
|
./devices/nos
|
|
|
|
secrets.nixosModules.nos
|
|
|
|
];
|
|
|
|
|
2024-05-20 22:41:45 -04:00
|
|
|
# Build / test server
|
2024-05-20 01:17:07 -04:00
|
|
|
servivi = mkNixOS [
|
|
|
|
./devices/servivi
|
|
|
|
secrets.nixosModules.servivi
|
|
|
|
];
|
|
|
|
|
|
|
|
# Cluster
|
|
|
|
thingone = mkNixOS [
|
|
|
|
(import ./devices/cluster "thingone")
|
|
|
|
secrets.nixosModules.thingy
|
|
|
|
];
|
|
|
|
thingtwo = mkNixOS [
|
|
|
|
(import ./devices/cluster "thingtwo")
|
|
|
|
secrets.nixosModules.thingy
|
|
|
|
];
|
|
|
|
|
|
|
|
live-image = mkNixOS [
|
|
|
|
("${nixpkgs}/nixos/modules/installer/"
|
|
|
|
+ "cd-dvd/installation-cd-minimal.nix")
|
|
|
|
{home-manager.users.nixos.home.stateVersion = "24.05";}
|
|
|
|
{
|
|
|
|
vars = {
|
|
|
|
mainUser = "nixos";
|
|
|
|
hostName = "nixos";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-05-20 22:41:45 -04:00
|
|
|
nixOnDroidConfigurations.default = mkNixOnDroid [./devices/android];
|
2024-05-20 01:17:07 -04:00
|
|
|
|
2024-06-26 14:47:14 -04:00
|
|
|
legacyPackages = perSystem (system: pkgs: let
|
|
|
|
mkScope = file:
|
2024-06-10 22:57:20 -04:00
|
|
|
pkgs.lib.recurseIntoAttrs
|
2024-06-26 14:47:14 -04:00
|
|
|
(pkgs.callPackage file ({inherit mkVersion;} // inputs));
|
|
|
|
in {
|
|
|
|
dracula = mkScope ./pkgs/dracula;
|
|
|
|
firefoxAddons = mkScope ./pkgs/firefox-addons;
|
|
|
|
mpvScripts = mkScope ./pkgs/mpv-scripts;
|
2024-06-10 22:57:20 -04:00
|
|
|
});
|
|
|
|
|
2024-06-08 22:21:04 -04:00
|
|
|
packages =
|
|
|
|
perSystem (system: pkgs:
|
2024-06-13 22:27:54 -04:00
|
|
|
import ./pkgs ({inherit self system pkgs mkVersion;} // inputs));
|
2024-06-08 22:21:04 -04:00
|
|
|
|
2024-05-20 01:17:07 -04:00
|
|
|
devShells = perSystem (_: pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
alejandra
|
|
|
|
git
|
2024-06-28 13:37:10 -04:00
|
|
|
nix-output-monitor
|
2024-05-20 01:17:07 -04:00
|
|
|
|
|
|
|
(writeShellScriptBin "mkIso" (lib.concatStrings [
|
2024-06-28 13:37:10 -04:00
|
|
|
"nom build $(realpath /etc/nixos)#nixosConfigurations."
|
2024-05-20 01:17:07 -04:00
|
|
|
"live-image.config.system.build.isoImage"
|
|
|
|
]))
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-07-20 09:38:17 -04:00
|
|
|
node = pkgs.mkShell {
|
|
|
|
packages = with pkgs;
|
|
|
|
[
|
|
|
|
nodejs_latest
|
|
|
|
typescript
|
|
|
|
]
|
|
|
|
++ (with nodePackages; [
|
|
|
|
ts-node
|
|
|
|
]);
|
2024-05-20 01:17:07 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
subtitles-dev = pkgs.mkShell {
|
|
|
|
packages = with pkgs;
|
|
|
|
[
|
|
|
|
nodejs_latest
|
|
|
|
ffmpeg-full
|
|
|
|
typescript
|
|
|
|
]
|
|
|
|
++ (with nodePackages; [
|
|
|
|
ts-node
|
|
|
|
]);
|
|
|
|
};
|
|
|
|
});
|
2024-05-20 22:41:45 -04:00
|
|
|
|
|
|
|
formatter = perSystem (_: pkgs: pkgs.alejandra);
|
|
|
|
|
2024-07-20 19:56:59 -04:00
|
|
|
# Scripts
|
|
|
|
apps = perSystem (system: pkgs: let
|
|
|
|
inherit (pkgs) lib callPackage;
|
|
|
|
in {
|
|
|
|
updateFlake = {
|
|
|
|
program = lib.getExe (callPackage ./apps/update ({} // inputs));
|
|
|
|
type = "app";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-05-20 22:41:45 -04:00
|
|
|
# For nix-fast-build
|
|
|
|
checks =
|
|
|
|
perSystem (system: pkgs:
|
2024-07-21 16:10:13 -04:00
|
|
|
import ./flake/ci.nix {inherit system pkgs self;});
|
2024-05-20 01:17:07 -04:00
|
|
|
};
|
|
|
|
}
|