Initial commit
This commit is contained in:
commit
e886de58af
23 changed files with 926 additions and 0 deletions
21
modules/audio.nix
Normal file
21
modules/audio.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
cava
|
||||
];
|
||||
}
|
||||
17
modules/bluetooth.nix
Normal file
17
modules/bluetooth.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
blueman
|
||||
];
|
||||
}
|
||||
17
modules/boot.nix
Normal file
17
modules/boot.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Bootloader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.systemd-boot.memtest86.enable = true;
|
||||
boot.loader.timeout = 5;
|
||||
# Create the traditional /bin directory with a symlink to bash for scripts
|
||||
system.activationScripts.binbash = {
|
||||
deps = [];
|
||||
text = ''
|
||||
mkdir -p /bin
|
||||
ln -sf ${pkgs.bash}/bin/bash /bin/bash
|
||||
'';
|
||||
};
|
||||
}
|
||||
39
modules/default.nix
Normal file
39
modules/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./audio.nix
|
||||
./bluetooth.nix
|
||||
./boot.nix
|
||||
./docker.nix
|
||||
./env.nix
|
||||
./fish.nix
|
||||
./fonts.nix
|
||||
./home-manager.nix
|
||||
./i3-xfce.nix
|
||||
./net.nix
|
||||
./nixos.nix
|
||||
./nvidia.nix
|
||||
./steam.nix
|
||||
./timezone.nix
|
||||
./user.nix
|
||||
];
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
programs.mtr.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
curl
|
||||
git
|
||||
home-manager
|
||||
];
|
||||
}
|
||||
14
modules/docker.nix
Normal file
14
modules/docker.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
enableOnBoot = true;
|
||||
autoPrune.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
docker
|
||||
docker-compose
|
||||
];
|
||||
}
|
||||
66
modules/env.nix
Normal file
66
modules/env.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Add user's bin directory to PATH and set up environment variables
|
||||
environment.shellInit = ''
|
||||
if [ -d $HOME/.cargo/bin ]; then
|
||||
export PATH=$PATH:$HOME/.cargo/bin
|
||||
fi
|
||||
if [ -f /run/current-system/sw/bin/python3 ]; then
|
||||
alias python3=/run/current-system/sw/bin/python3
|
||||
alias python=/run/current-system/sw/bin/python3
|
||||
fi
|
||||
'';
|
||||
|
||||
# Setup development environment variables
|
||||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
TERM = "xterm-256color";
|
||||
GTK_THEME = "Adwaita:dark";
|
||||
CC = "${pkgs.gcc}/bin/gcc";
|
||||
PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" [
|
||||
pkgs.openssl.dev
|
||||
pkgs.libxml2.dev
|
||||
pkgs.zlib.dev
|
||||
];
|
||||
};
|
||||
|
||||
environment.pathsToLink = [
|
||||
"/share/fish"
|
||||
"/lib/python3.10/site-packages"
|
||||
"/lib/python3.11/site-packages"
|
||||
"/bin"
|
||||
];
|
||||
|
||||
# Terminal utilities
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
tmux
|
||||
htop
|
||||
bat
|
||||
ripgrep
|
||||
fd
|
||||
yt-dlp
|
||||
eza
|
||||
jq
|
||||
fzf
|
||||
starship
|
||||
yazi
|
||||
fastfetch
|
||||
# Core utilities
|
||||
wget
|
||||
libnotify
|
||||
curl
|
||||
git
|
||||
file
|
||||
which
|
||||
psmisc
|
||||
];
|
||||
|
||||
# Enable direnv with nix integration
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
||||
14
modules/fish.nix
Normal file
14
modules/fish.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.fish.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
starship
|
||||
fzf
|
||||
bat
|
||||
eza
|
||||
fd
|
||||
ripgrep
|
||||
];
|
||||
}
|
||||
37
modules/fonts.nix
Normal file
37
modules/fonts.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-emoji
|
||||
(nerdfonts.override { fonts = [ "0xProto" "FiraCode" "JetBrainsMono" "Hack" "Noto" "NerdFontsSymbolsOnly" ]; })
|
||||
ipafont
|
||||
kochi-substitute
|
||||
# Custom BinaryClock font
|
||||
(stdenv.mkDerivation {
|
||||
name = "binary-clock-font";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/jamessouth/polybar-binary-clock-fonts/raw/master/BinaryClockBoldMono.ttf";
|
||||
sha256 = "0vxy23zr8r8faa5s7vy5bf8z2q7my39ghmd9ilk7aww9wqsrsjqx";
|
||||
};
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/fonts/truetype
|
||||
cp $src $out/share/fonts/truetype/BinaryClockBoldMono.ttf
|
||||
'';
|
||||
})
|
||||
];
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
defaultFonts = {
|
||||
monospace = [ "JetBrains Mono" "Noto Sans Mono CJK JP" ];
|
||||
sansSerif = [ "Noto Sans" "Noto Sans CJK JP" ];
|
||||
serif = [ "Noto Serif" "Noto Serif CJK JP" ];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
16
modules/home-manager.nix
Normal file
16
modules/home-manager.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, pkgs, lib, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
# Import the home-manager config for cobray user
|
||||
users.cobray = import ../home-manager/cobray.nix;
|
||||
};
|
||||
}
|
||||
84
modules/i3-xfce.nix
Normal file
84
modules/i3-xfce.nix
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
services.xserver.enable = true;
|
||||
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
services.xserver.windowManager.i3 = {
|
||||
enable = true;
|
||||
package = pkgs.i3-gaps;
|
||||
extraPackages = with pkgs; [
|
||||
dmenu
|
||||
i3status
|
||||
i3lock
|
||||
i3blocks
|
||||
picom
|
||||
feh
|
||||
rofi
|
||||
dunst
|
||||
polybar
|
||||
];
|
||||
extraSessionCommands = ''
|
||||
# Set random wallpaper
|
||||
${pkgs.feh}/bin/feh --randomize --bg-fill ~/wallpapers/* || ${pkgs.feh}/bin/feh --bg-fill ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nineish-dark-gray.png &
|
||||
'';
|
||||
};
|
||||
|
||||
services.xserver.desktopManager.xfce = {
|
||||
enable = true;
|
||||
noDesktop = true;
|
||||
enableXfwm = false;
|
||||
};
|
||||
services.xserver.displayManager.lightdm = {
|
||||
enable = true;
|
||||
background = "#000000";
|
||||
greeters.gtk = {
|
||||
enable = true;
|
||||
theme.name = "Adwaita-dark";
|
||||
iconTheme.name = "Papirus-Dark";
|
||||
};
|
||||
};
|
||||
services.xserver.displayManager.defaultSession = "xfce+i3";
|
||||
services.xserver.displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "cobray";
|
||||
};
|
||||
environment.etc."xdg/autostart/i3-setup.desktop" = {
|
||||
text = ''
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=i3 Setup
|
||||
Exec=${pkgs.bash}/bin/bash -c "${pkgs.feh}/bin/feh --randomize --bg-fill ~/wallpapers/* || ${pkgs.feh}/bin/feh --bg-fill ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nineish-dark-gray.png"
|
||||
Terminal=false
|
||||
X-GNOME-Autostart-enabled=true
|
||||
'';
|
||||
mode = "0644";
|
||||
};
|
||||
|
||||
qt.enable = true;
|
||||
qt.platformTheme = "gnome";
|
||||
qt.style = "adwaita-dark";
|
||||
environment.etc."gtk-3.0/settings.ini".text = ''
|
||||
[Settings]
|
||||
gtk-application-prefer-dark-theme=1
|
||||
gtk-theme-name=Adwaita-dark
|
||||
gtk-icon-theme-name=Papirus-Dark
|
||||
gtk-font-name=Sans 10
|
||||
'';
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
arandr
|
||||
nitrogen
|
||||
xclip
|
||||
lxappearance
|
||||
arc-theme
|
||||
arc-icon-theme
|
||||
papirus-icon-theme
|
||||
numix-icon-theme-circle
|
||||
candy-icons
|
||||
];
|
||||
}
|
||||
18
modules/net.nix
Normal file
18
modules/net.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
networking.wireless.enable = false; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
networking.firewall.enable = false;
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
34
modules/nixos.nix
Normal file
34
modules/nixos.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Fix Python package issues
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
python310Packages = prev.python310Packages.override {
|
||||
overrides = pyFinal: pyPrev: {
|
||||
terminado = pyPrev.terminado.overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
doInstallCheck = false;
|
||||
});
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
# Enable nix-index for command-not-found
|
||||
programs.nix-index.enable = true;
|
||||
programs.command-not-found.enable = false;
|
||||
# Setup nix settings
|
||||
nix.settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
];
|
||||
};
|
||||
}
|
||||
18
modules/nvidia.nix
Normal file
18
modules/nvidia.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
# Set to true for RTX 4000 series and newer GPUs
|
||||
open = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
cudaPackages.cudatoolkit
|
||||
];
|
||||
}
|
||||
34
modules/steam.nix
Normal file
34
modules/steam.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, pkgs, lib, inputs, system, ... }:
|
||||
|
||||
{
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
gamescopeSession.enable = true;
|
||||
extraCompatPackages = [
|
||||
inputs.nix-gaming.packages.${system}.proton-ge
|
||||
];
|
||||
};
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
lutris
|
||||
wineWowPackages.stable
|
||||
winetricks
|
||||
protontricks
|
||||
gamemode
|
||||
mangohud
|
||||
vulkan-tools
|
||||
vulkan-loader
|
||||
vulkan-headers
|
||||
vulkan-validation-layers
|
||||
libstrangle
|
||||
piper
|
||||
];
|
||||
environment.variables = {
|
||||
LD_LIBRARY_PATH = "${pkgs.mangohud}/lib";
|
||||
};
|
||||
}
|
||||
6
modules/timezone.nix
Normal file
6
modules/timezone.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
time.timeZone = "America/Edmonton";
|
||||
i18n.defaultLocale = "en_CA.UTF-8";
|
||||
}
|
||||
20
modules/user.nix
Normal file
20
modules/user.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
users.users.cobray = {
|
||||
isNormalUser = true;
|
||||
description = "Mon Aie";
|
||||
extraGroups = [ "networkmanager" "wheel" "docker" "video" ];
|
||||
shell = pkgs.fish;
|
||||
packages = with pkgs; [
|
||||
# User-specific packages can be defined here
|
||||
# or through home-manager
|
||||
];
|
||||
};
|
||||
|
||||
security.sudo = {
|
||||
enable = true;
|
||||
wheelNeedsPassword = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue