nix-configs/flake.nix
2024-01-16 18:04:31 +00:00

112 lines
3.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
description = "Generic System Flake file";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
disko = {
url = github:nix-community/disko;
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, disko, ... }@inputs: {
nixosConfigurations = {
"nixos" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Add Disko for disk management
disko.nixosModules.disko
./disko-config.nix
{
_module.args.disks = [ "/dev/vda" ];
}
./hardware-configuration.nix
];
};
"dev-one" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Add Disko for disk management
disko.nixosModules.disko
./disko-config.nix
{
_module.args.disks = [ "/dev/vda" ];
}
# Add Home-manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.aaronh = import ./home.nix;
}
./hardware-configuration.nix
];
};
{config, pkgs, ...}: {
nix = {
settings.auto-optimise-store = true;
settings.experimental-features = [ "nix-command" "flakes" ];
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot.enable = true;
systemd-boot.consoleMode = "0";
};
};
networking = {
hostName = "nixos";
networkmanager.enable = true;
};
users.users.aaronh = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx.";
};
environment.systemPackages = with pkgs; [
git
git-lfs
tree
wget
];
# Enable/Disable hardware
## Turn off PulseAudio
hardware.pulseaudio.enable = false;
# Enable Pipewire
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
services.openssh = {
enable = true;
settings.PermitRootLogin = "no";
};
system = {
stateVersion = "23.11";
autoUpgrade.enable = true;
};
};
};
};
}