1
0
Fork 0

feat(nix): add nix flakes

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2024-07-26 21:13:56 -07:00
parent edbd8ce1d2
commit 35e75575f8
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47
7 changed files with 496 additions and 0 deletions

View 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. Its 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";
};
};
};
}

View 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
View 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. Its 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 ]; };
}