2024-07-08 09:35:53 -05:00
|
|
|
{
|
|
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-24.05";
|
2024-07-08 12:18:24 -05:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-07-08 09:35:53 -05:00
|
|
|
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
|
|
|
|
pkgsFor = func: (nixpkgs.lib.genAttrs systems (system: (func (import nixpkgs {inherit system;}))));
|
|
|
|
in {
|
|
|
|
packages = pkgsFor (pkgs: {
|
2024-07-08 12:18:24 -05:00
|
|
|
default = pkgs.callPackage ./what-is-my-ip.nix {};
|
2024-07-08 12:38:39 -05:00
|
|
|
container = pkgs.dockerTools.buildImage {
|
|
|
|
name = "what-is-my-ip-container";
|
|
|
|
config = {
|
|
|
|
Cmd = ["${self.outputs.packages.${pkgs.system}.default}/bin/what-is-my-ip"];
|
|
|
|
};
|
|
|
|
};
|
2024-07-08 12:18:24 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
devShells = pkgsFor (pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = [self.outputs.packages.${pkgs.system}.default];
|
|
|
|
shellHook = ''
|
|
|
|
echo "Hello, Nix!"
|
|
|
|
'';
|
|
|
|
};
|
2024-07-08 09:35:53 -05:00
|
|
|
});
|
2024-07-08 12:38:39 -05:00
|
|
|
|
|
|
|
nixosConfigurations = let
|
|
|
|
system = "x86_64-linux";
|
|
|
|
in {
|
|
|
|
default = nixpkgs.lib.nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [
|
|
|
|
{
|
|
|
|
users.users.alice = {
|
|
|
|
isNormalUser = true;
|
|
|
|
# enable sudo
|
|
|
|
extraGroups = ["wheel"];
|
|
|
|
packages = [
|
|
|
|
self.outputs.packages.${system}.default
|
|
|
|
];
|
|
|
|
initialPassword = "swordfish";
|
|
|
|
};
|
|
|
|
system.stateVersion = "24.05";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2024-07-08 09:35:53 -05:00
|
|
|
};
|
|
|
|
}
|