Nixos stuff!

This commit is contained in:
Sky Hearn 2024-02-27 04:51:16 +00:00
parent c41f72a4e5
commit 971ab02a11
Signed by: fallingsky04
GPG Key ID: DAB485883AE426EC
5 changed files with 116 additions and 12 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
result
nixos-switch.log
hardware_configuration.nix

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "slstatus"]
path = slstatus
url = git://git.suckless.org/slstatus

View File

@ -8,19 +8,35 @@
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
<home-manager/nixos>
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# amdgpu stuffs
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ];
# opengl support
hardware.opengl.enable = true;
# opengl packages
hardware.opengl.extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
vaapiVdpau
libvdpau-va-gl
];
hardware.opengl.driSupport = true;
networking.hostName = "sky-laptop"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "US/SanFrancisco";
time.timeZone = "America/Los_Angeles";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
@ -55,25 +71,62 @@
services.xserver.windowManager.dwm.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.sky = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
packages = with pkgs; [
firefox
tree
git
keepassxc
];
};
# Sky User
users.users.sky.isNormalUser = true;
users.users.sky.extraGroups = [ "wheel" ]; # Enable sudo for the user.
# Home Manager for Sky
home-manager.users.sky = {pkgs, ...}: {
home.packages = with pkgs; [
firefox-bin
neofetch
ncpamixer
tree
neovim
xclip
grpc
clipcat
keepassxc
jellyfin-media-player
];
services.picom = {
enable = true;
vSync = true;
backend = "glx";
};
programs.git = {
enable = true;
userName = "Sky Hearn";
userEmail = "sky.hearn@pm.me";
signing = {
key = "DAB485883AE426EC";
signByDefault = true;
};
};
home.stateVersion = "23.11";
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
pulseaudio
bash
vim
wget
acpi
st
dmenu
(let local_slstatus = pkgs.slstatus.overrideAttrs (_: {
src = ./slstatus;
}); in
(local_slstatus.override {
conf = ./slstatus/config.def.h;
})
)
libva-utils
];
# Some programs need SUID wrappers, can be configured further or are
@ -84,6 +137,19 @@
enableSSHSupport = true;
};
# clipcat systemd service
systemd.services.clipcat = {
partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
description = "Clipcat Daemon";
serviceConfig = {
ExecStart = ''/usr/bin/clipcatd --no-daemon --replace''; # TODO: find where to actually run clipcatd
Restart = "on-failure";
Type = "simple";
};
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
@ -119,4 +185,3 @@
system.stateVersion = "23.11"; # Did you read the comment?
}

32
rebuild Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
# A rebuild script that commits on a successful build
set -e
# cd to your config dir
pushd ~/nixos/
# Edit your config
nvim configuration.nix
# Autoformat your nix files
# alejandra . &>/dev/null
# Shows your changes
git diff -U0 *.nix
echo "NixOS Rebuilding..."
# Rebuild, output simplified errors, log trackebacks
sudo nixos-rebuild switch &>nixos-switch.log || (cat nixos-switch.log | grep --color error && false)
# Get current generation metadata
current=$(nixos-rebuild list-generations | grep current)
# Commit all changes witih the generation metadata
git commit -am "$current"
# Back to where you were
popd
# Notify all OK!
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available

1
slstatus Submodule

@ -0,0 +1 @@
Subproject commit 3f2d2b2dc1f8326805fe3276f2a893bf5a58c8da