feat(nix): add nix flakes
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
edbd8ce1d2
commit
35e75575f8
7 changed files with 496 additions and 0 deletions
82
nix/flake.lock
generated
Normal file
82
nix/flake.lock
generated
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710146030,
|
||||||
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721996913,
|
||||||
|
"narHash": "sha256-eqbhEBObarS6WsI0J1PVACQ8fXeq9OmSS0+iXBegoOI=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "bc2b96acda50229bc99925dde5c8e561e90b0b00",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721924956,
|
||||||
|
"narHash": "sha256-Sb1jlyRO+N8jBXEX9Pg9Z1Qb8Bw9QyOgLDNMEpmjZ2M=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "5ad6a14c6bf098e98800b091668718c336effc95",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
28
nix/flake.nix
Normal file
28
nix/flake.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
description = "priime0 nixos configuration";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, home-manager, flake-utils, ... }@inputs:
|
||||||
|
let inherit (self) outputs;
|
||||||
|
in {
|
||||||
|
nixosConfigurations.framework = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = { inputs = inputs; };
|
||||||
|
modules = [
|
||||||
|
home-manager.nixosModule
|
||||||
|
./hosts/common/sys.nix
|
||||||
|
./hosts/framework/sys.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
17
nix/hosts/common/home.nix
Normal file
17
nix/hosts/common/home.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ inputs, configDir, config, pkgs, lib, ... }: {
|
||||||
|
# Extra $PATH directories
|
||||||
|
home.sessionPath = [ ];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Lucas Sta Maria";
|
||||||
|
userEmail = "lucas@priime.dev";
|
||||||
|
signing = {
|
||||||
|
signByDefault = true;
|
||||||
|
key = "2EAF5BA156A36810B057BF61F07FB16A826E3B47";
|
||||||
|
};
|
||||||
|
extraConfig = { credential.helper = "store"; };
|
||||||
|
};
|
||||||
|
}
|
75
nix/hosts/common/sys.nix
Normal file
75
nix/hosts/common/sys.nix
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
{ inputs, config, lib, pkgs, ... }: {
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
extraOptions = ''
|
||||||
|
extra-experimental-features = nix-command flakes
|
||||||
|
build-users-group = nixbld
|
||||||
|
'';
|
||||||
|
settings = {
|
||||||
|
trusted-users = [ "root" "priime" ];
|
||||||
|
substituters =
|
||||||
|
[ "https://cache.nixos.org/" "https://nix-community.cachix.org" ];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
];
|
||||||
|
sandbox = true;
|
||||||
|
};
|
||||||
|
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs;
|
||||||
|
let
|
||||||
|
packages = [
|
||||||
|
nixos-rebuild
|
||||||
|
coreutils
|
||||||
|
git
|
||||||
|
gnupg
|
||||||
|
bottom
|
||||||
|
htop
|
||||||
|
bat
|
||||||
|
jq
|
||||||
|
unzip
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
libtool
|
||||||
|
fish
|
||||||
|
gcc
|
||||||
|
gnumake
|
||||||
|
cmake
|
||||||
|
tldr
|
||||||
|
emacs
|
||||||
|
man-pages
|
||||||
|
gdb
|
||||||
|
zsh
|
||||||
|
alsa-utils
|
||||||
|
killall
|
||||||
|
feh
|
||||||
|
xcolor
|
||||||
|
xclip
|
||||||
|
xdotool
|
||||||
|
ripgrep
|
||||||
|
|
||||||
|
nix-index
|
||||||
|
|
||||||
|
cargo
|
||||||
|
rustup
|
||||||
|
rustfmt
|
||||||
|
clippy
|
||||||
|
rust-analyzer
|
||||||
|
|
||||||
|
python3
|
||||||
|
|
||||||
|
nodejs
|
||||||
|
yarn
|
||||||
|
|
||||||
|
racket
|
||||||
|
|
||||||
|
jdk8
|
||||||
|
jdk21
|
||||||
|
jdk22
|
||||||
|
|
||||||
|
nodejs_20
|
||||||
|
];
|
||||||
|
in packages;
|
||||||
|
}
|
122
nix/hosts/framework/home.nix
Normal file
122
nix/hosts/framework/home.nix
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
{ inputs, configDir, config, pkgs, lib, ... }: {
|
||||||
|
imports = [ ../common/home.nix ];
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
home.stateVersion = "23.11"; # Did you read the comment?
|
||||||
|
|
||||||
|
home.packages = let
|
||||||
|
packages = with pkgs; [
|
||||||
|
pavucontrol
|
||||||
|
pamixer
|
||||||
|
picom
|
||||||
|
rofi
|
||||||
|
notify-desktop
|
||||||
|
pass
|
||||||
|
just
|
||||||
|
zathura
|
||||||
|
libvterm
|
||||||
|
texliveFull
|
||||||
|
flameshot
|
||||||
|
brightnessctl
|
||||||
|
pinentry-gtk2
|
||||||
|
bluez5-experimental
|
||||||
|
bluez-tools
|
||||||
|
blueman
|
||||||
|
dmenu
|
||||||
|
pipewire
|
||||||
|
dconf
|
||||||
|
mu
|
||||||
|
isync
|
||||||
|
openssl
|
||||||
|
meson
|
||||||
|
glib
|
||||||
|
stow
|
||||||
|
syncthing
|
||||||
|
nitrogen
|
||||||
|
redshift
|
||||||
|
networkmanager
|
||||||
|
|
||||||
|
firefox
|
||||||
|
discord
|
||||||
|
steam
|
||||||
|
bitwarden
|
||||||
|
nautilus
|
||||||
|
obs-studio
|
||||||
|
vlc
|
||||||
|
easyeffects
|
||||||
|
thunderbird
|
||||||
|
signal-desktop
|
||||||
|
kdeconnect
|
||||||
|
(prismlauncher.override { jdks = [ jdk22 ]; })
|
||||||
|
tidal-hifi
|
||||||
|
zotero
|
||||||
|
|
||||||
|
emacs
|
||||||
|
alacritty
|
||||||
|
|
||||||
|
jdk22
|
||||||
|
|
||||||
|
noto-fonts
|
||||||
|
fira-code
|
||||||
|
open-sans
|
||||||
|
inter
|
||||||
|
roboto-mono
|
||||||
|
jetbrains-mono
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
];
|
||||||
|
in packages;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "emacsclient";
|
||||||
|
CC = "gcc";
|
||||||
|
LSP_USE_PLISTS = "true";
|
||||||
|
MOZ_USE_XINPUT2 = "1";
|
||||||
|
};
|
||||||
|
|
||||||
|
### Services
|
||||||
|
|
||||||
|
# Compositor
|
||||||
|
services.picom = {
|
||||||
|
enable = true;
|
||||||
|
backend = "glx";
|
||||||
|
activeOpacity = 1;
|
||||||
|
inactiveOpacity = 0.9;
|
||||||
|
settings = {
|
||||||
|
blur = {
|
||||||
|
method = "kawase";
|
||||||
|
size = 20;
|
||||||
|
deviation = 5.0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
### Programs
|
||||||
|
programs.alacritty = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
shell = "fish";
|
||||||
|
font.size = 5;
|
||||||
|
font.normal = {
|
||||||
|
family = "JetBrains Mono";
|
||||||
|
style = "SemiBold";
|
||||||
|
};
|
||||||
|
font.bold = {
|
||||||
|
family = "JetBrains Mono";
|
||||||
|
style = "Bold";
|
||||||
|
};
|
||||||
|
font.italic = {
|
||||||
|
family = "JetBrains Mono";
|
||||||
|
style = "Italic";
|
||||||
|
};
|
||||||
|
font.bold_italic = {
|
||||||
|
family = "JetBrains Mono";
|
||||||
|
style = "Bold Italic";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
39
nix/hosts/framework/hw.nix
Normal file
39
nix/hosts/framework/hw.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules =
|
||||||
|
[ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/185554c8-457b-4839-8087-6c55d5534870";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.luks.devices."luks-72d425c2-53a4-435b-b560-347e400294e9".device =
|
||||||
|
"/dev/disk/by-uuid/72d425c2-53a4-435b-b560-347e400294e9";
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/AC29-FAB9";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp193s0f3u2u2.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode =
|
||||||
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
133
nix/hosts/framework/sys.nix
Normal file
133
nix/hosts/framework/sys.nix
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
{ inputs, config, pkgs, lib, ... }: {
|
||||||
|
imports = [ ./hw.nix ];
|
||||||
|
|
||||||
|
networking.hostName = "framework";
|
||||||
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|
||||||
|
# Bootloader
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
# Network Manager
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Fonts
|
||||||
|
fonts = {
|
||||||
|
fontDir.enable = true;
|
||||||
|
enableDefaultPackages = true;
|
||||||
|
fontconfig = {
|
||||||
|
enable = true;
|
||||||
|
defaultFonts = { monospace = [ "Roboto Mono" ]; };
|
||||||
|
};
|
||||||
|
packages = with pkgs; [
|
||||||
|
noto-fonts
|
||||||
|
fira-code
|
||||||
|
open-sans
|
||||||
|
inter
|
||||||
|
roboto-mono
|
||||||
|
jetbrains-mono
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
i18n.extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "en_US.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||||
|
LC_MEASUREMENT = "en_US.UTF-8";
|
||||||
|
LC_MONETARY = "en_US.UTF-8";
|
||||||
|
LC_NAME = "en_US.UTF-8";
|
||||||
|
LC_NUMERIC = "en_US.UTF-8";
|
||||||
|
LC_PAPER = "en_US.UTF-8";
|
||||||
|
LC_TELEPHONE = "en_US.UTF-8";
|
||||||
|
LC_TIME = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Bluetooth
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
services.blueman.enable = true;
|
||||||
|
|
||||||
|
# Audio
|
||||||
|
hardware.pulseaudio.enable = false;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# AMD
|
||||||
|
hardware.cpu.amd.updateMicrocode = true;
|
||||||
|
hardware.graphics.enable = true;
|
||||||
|
|
||||||
|
# Power
|
||||||
|
powerManagement = {
|
||||||
|
enable = true;
|
||||||
|
powertop.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Autologin
|
||||||
|
services.displayManager.autoLogin.user = "priime";
|
||||||
|
|
||||||
|
# Mouse
|
||||||
|
services.libinput.mouse = { middleEmulation = false; };
|
||||||
|
|
||||||
|
users.users.priime = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Lucas";
|
||||||
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
packages = with pkgs; [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
documentation.dev.enable = true;
|
||||||
|
|
||||||
|
### Services
|
||||||
|
|
||||||
|
# xserver and i3
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
windowManager.i3.enable = true;
|
||||||
|
displayManager.lightdm.enable = true;
|
||||||
|
xkb.layout = "us";
|
||||||
|
xkb.variant = "dvp";
|
||||||
|
autoRepeatDelay = 350;
|
||||||
|
autoRepeatInterval = 17;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.tailscale = {
|
||||||
|
enable = true;
|
||||||
|
useRoutingFeatures = "client";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.syncthing = {
|
||||||
|
enable = true;
|
||||||
|
user = "priime";
|
||||||
|
dataDir = "/home/priime/syncthing";
|
||||||
|
configDir = "/home/priime/.config/syncthing";
|
||||||
|
overrideDevices = true;
|
||||||
|
overrideFolders = false;
|
||||||
|
settings = {
|
||||||
|
devices = { };
|
||||||
|
folders = { };
|
||||||
|
gui = { user = "priime"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Programs
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
pinentryPackage = lib.mkForce pkgs.pinentry-gtk2;
|
||||||
|
};
|
||||||
|
programs.kdeconnect.enable = true;
|
||||||
|
programs.steam.enable = true;
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
|
home-manager.users.priime = { pkgs, ... }: { imports = [ ./home.nix ]; };
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue