Sorry for the kinda big commit that does everything at once This change does the following: - yeets skrott and skrot-specific settings from the NixOS module, - adds a bunch more settings and generalizations to the NixOS module, - adds two VM NixOS configurations for interactive testing - wraps the nix package so that `less` is always present in `$PATH` - yeah, that's about it kthxbye
67 lines
2.0 KiB
Nix
67 lines
2.0 KiB
Nix
{
|
|
description = "Dibbler samspleisebod";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
outputs = { self, nixpkgs, flake-utils }: let
|
|
inherit (nixpkgs) lib;
|
|
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
|
|
forAllSystems = f: lib.genAttrs systems (system: let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in f system pkgs);
|
|
in {
|
|
apps = let
|
|
mkApp = program: description: {
|
|
type = "app";
|
|
program = toString program;
|
|
meta = {
|
|
inherit description;
|
|
};
|
|
};
|
|
mkVm = name: mkApp "${self.nixosConfigurations.${name}.config.system.build.vm}/bin/run-nixos-vm";
|
|
in forAllSystems (system: pkgs: {
|
|
default = self.apps.${system}.dibbler;
|
|
dibbler = flake-utils.lib.mkApp {
|
|
drv = self.packages.${system}.dibbler;
|
|
};
|
|
vm = mkVm "vm" "Start a NixOS VM with dibbler installed in kiosk-mode";
|
|
vm-non-kiosk = mkVm "vm-non-kiosk" "Start a NixOS VM with dibbler installed in nonkiosk-mode";
|
|
});
|
|
|
|
nixosModules.default = import ./nix/module.nix;
|
|
|
|
nixosConfigurations = {
|
|
vm = import ./nix/nixos-configurations/vm.nix { inherit self nixpkgs; };
|
|
vm-non-kiosk = import ./nix/nixos-configurations/vm-non-kiosk.nix { inherit self nixpkgs; };
|
|
};
|
|
|
|
overlays = {
|
|
default = self.overlays.dibbler;
|
|
dibbler = final: prev: {
|
|
inherit (self.packages.${prev.system}) dibbler;
|
|
};
|
|
};
|
|
|
|
devShells = forAllSystems (system: pkgs: {
|
|
default = self.devShells.${system}.dibbler;
|
|
dibbler = pkgs.callPackage ./nix/shell.nix {
|
|
python = pkgs.python312;
|
|
};
|
|
});
|
|
|
|
packages = forAllSystems (system: pkgs: {
|
|
default = self.packages.${system}.dibbler;
|
|
dibbler = pkgs.callPackage ./nix/package.nix {
|
|
python3Packages = pkgs.python312Packages;
|
|
};
|
|
});
|
|
};
|
|
}
|