This repository has been archived on 2024-06-05. You can view files and clone it, but cannot push or open issues or pull requests.
dtsense/flake.nix

67 lines
2.2 KiB
Nix
Raw Normal View History

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
let supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
in (utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
makeImage = conf:
(conf.extendModules {
modules = [{
config.nixpkgs = {
hostPlatform.system = conf.config.nixpkgs.system;
buildPlatform.system = system;
};
}];
}).config.system.build.sdImage;
in {
formatter = pkgs.nixfmt;
packages = lib.mapAttrs'
(name: value: lib.nameValuePair "${name}-sdimage" (makeImage value))
self.nixosConfigurations;
})) // {
nixosModules.minify = { ... }: {
disabledModules = [ "profiles/base.nix" ];
config = {
2023-12-09 03:54:26 +00:00
boot.bcache.enable = false;
environment.defaultPackages = [ ];
fonts.fontconfig.enable = false;
networking.firewall.enable = false;
nix.enable = false;
2023-12-09 03:54:26 +00:00
programs.nano.enable = false;
services.lvm.enable = false;
# We could theoretically disable system-path.nix so we don't have
# requiredPackages, but that seems like a lot of work.
# Leave networking.useDHCP = true since we would reenable it anyway
# Just set this to something, we probably don't care
system.stateVersion = "23.11";
};
};
nixosModules.insecureRemote = { ... }: {
services.openssh = {
enable = true;
settings.PermitRootLogin = "yes";
};
2023-12-09 03:54:26 +00:00
users.users.root.initialPassword = "ohnowo";
};
nixosConfigurations.aarch64-rpi = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
self.nixosModules.minify
2023-12-09 03:54:26 +00:00
self.nixosModules.insecureRemote
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
];
};
};
}