nixos/flake.nix

95 lines
2.7 KiB
Nix

{
description = "Nixos config flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
musnix.url = "github:musnix/musnix";
musnix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
nixpkgs,
nixpkgs-unstable,
home-manager,
sops-nix,
musnix,
...
} @ inputs: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [
# make unstable packages available via overlay
(final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
})
];
config = {
allowUnfreePredicate = pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"discord"
"samsung-UnifiedLinuxDriver"
"steam"
"steam-unwrapped"
"stm32cubemx"
];
};
};
in {
nixosConfigurations = {
"MaxNixosLaptop" = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs pkgs system;
};
modules = [
./hosts/MaxNixosLaptop/configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.default
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [
sops-nix.homeManagerModules.sops
];
}
musnix.nixosModules.musnix
];
};
ServerIso = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
#./machine.nix
(nixpkgs
+ "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
(nixpkgs + "/nixos/modules/installer/cd-dvd/channel.nix")
({pkgs, ...}: {
# Enable SSH in the boot process.
systemd.services.sshd.wantedBy =
pkgs.lib.mkForce ["multi-user.target"];
users.users.root.openssh.authorizedKeys.keys = [
# your ssh key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOLRNvgrjnBizuruEm6htmvc6F1uGath9T7WjAh6ogPD root@host"
];
isoImage.squashfsCompression = "gzip -Xcompression-level 1";
networking = {
usePredictableInterfaceNames = false;
useDHCP = true;
nameservers = ["1.1.1.1"];
hostName = "host";
};
})
];
};
};
};
}