nix-configs/flake.nix

122 lines
3.6 KiB
Nix

{
description = "system";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-24.11";
nixpkgs-unstable-small.url = "nixpkgs/nixos-unstable-small";
niri.url = "github:sodiboo/niri-flake";
stylix.url = "github:danth/stylix";
typst-within.url = "github:schrottkatze/typst";
crane.url = "github:ipetkov/crane";
lix-module = {
url = "git+https://git.lix.systems/lix-project/nixos-module";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-stable,
nixpkgs-unstable-small,
lix-module,
typst-within,
home-manager,
nixos-hardware,
niri,
stylix,
fenix,
crane,
...
} @ inputs: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
pkgs-unstable-small = nixpkgs-unstable-small.legacyPackages.${system};
rs-toolchain = with fenix.packages.${system};
combine [
complete.toolchain
];
crane-lib = (crane.mkLib nixpkgs.legacyPackages.${system}).overrideToolchain rs-toolchain;
rs-programs = final: prev: {
s10e-jrnl = crane-lib.buildPackage {
pname = "s10e-bs";
version = "0.0.1";
src = crane-lib.cleanCargoSource (crane-lib.path ./.);
};
};
in {
devShells."x86_64-linux".default = pkgs.mkShell {
buildInputs = [
rs-toolchain
pkgs.pkg-config
pkgs.openssl
];
};
nixosConfigurations = {
monosodium-glutamate-g = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small pkgs-stable rs-programs lix-module niri;
};
system = "x86_64-linux";
modules = [
inputs.niri.nixosModules.niri
stylix.nixosModules.stylix
./hosts/monosodium-glutamate-g/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit pkgs-unstable-small pkgs-stable typst-within;
};
home-manager.users.jade = {
nixosConfig,
pkgs,
...
}: {
home.sessionVariables.TZ = nixosConfig.time.timeZone;
home.stateVersion = "${nixosConfig.system.stateVersion}";
};
}
];
};
denkbrett = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small pkgs-stable rs-programs lix-module niri;
};
system = "x86_64-linux";
modules = [
inputs.niri.nixosModules.niri
stylix.nixosModules.stylix
./hosts/denkbrett/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit pkgs-unstable-small pkgs-stable typst-within;
};
home-manager.users.jade = {
nixosConfig,
pkgs,
...
}: {
home.sessionVariables.TZ = nixosConfig.time.timeZone;
home.stateVersion = "22.11";
};
}
];
};
};
};
}