Files
nixos/flake.nix
2026-02-26 23:27:43 +00:00

146 lines
6.2 KiB
Nix

{
description = "Stationette nix config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
#impermanence = {
# url = "github:nix-community/impermanence";
# inputs.nixpkgs.follows = "";
# inputs.home-manager.follows = "";
#};
#home-manager.url = "github:nix-community/home-manager/release-25.11";
#home-manager.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko/latest";
disko.inputs.nixpkgs.follows = "nixpkgs-unstable";
#firefox-addons = {
# url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
# inputs.nixpkgs.follows = "nixpkgs";
#};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
#home-manager,
#impermanence,
disko,
...
} @ inputs: let
lib = nixpkgs.lib;
# Supported systems for your flake packages, shell, etc.
# "aarch64-linux"
# "i686-linux"
# "x86_64-linux"
# "aarch64-darwin"
# "x86_64-darwin"
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
#pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
in {
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#stationette'
nixosConfigurations = {
stationette = nixpkgs.lib.nixosSystem {
modules = [
./hardware-configuration.nix
{
imports = [
{
#imports = [
# ./boot.nix
# ./networking.nix
# ./packages.nix
# ./programs.nix
# ./users.nix
#];
}
];
system.stateVersion = "25.11";
}
disko.nixosModules.disko
# nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- --flake=./#stationette --disk=stationette /dev/sda
{
disko.devices = {
disk = {
stationette = {
type = "disk";
device = "/dev/sda"; # Check this with lsblk
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Force overwrite
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "8G";
};
};
};
};
};
};
};
};
};
}
#home-manager.nixosModules.home-manager
#{
# imports = [
# impermanence.nixosModules.impermanence
# ];
# home-manager = {
# users.chris = import ./home;
# extraSpecialArgs = {
# inherit pkgs-unstable;
# inherit inputs;
# };
# };
#}
];
};
};
# Standalone home-manager configuration entrypoint
#homeConfigurations = {
# chris = home-manager.lib.homeManagerConfiguration {
# inherit pkgs;
# extraSpecialArgs = {
# inherit pkgs-unstable;
# inherit inputs;
# };
# modules = [
# ./home
# ];
# };
#};
};
}