diff --git a/configuration.nix b/configuration.nix index b770dbb..3f9272d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,21 +1,27 @@ -# Edit this configuration file to define what should be installed on your system. Help is available in the +# Edit this configuration file to define what should be installed on your system. Help is available in the # configuration.nix(5) man page and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - -{ imports = - [ # Include the results of the hardware scan. - /etc/nixos/hardware-configuration.nix ]; +{ + config, + pkgs, + pkgs-stable, + inputs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + /etc/nixos/hardware-configuration.nix + ]; # Bootloader. - boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; # Use latest kernel. boot.kernelPackages = pkgs.linuxPackages_latest; - networking.hostName = "ArcticFox"; # Define your hostname. + networking.hostName = "ArcticFox"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Configure network proxy if necessary networking.proxy.default = "http://user:password@proxy:port/"; + # Configure network proxy if necessary networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; ##################### ## NETWORKING @@ -31,17 +37,39 @@ ]; peers = [ { - allowedIPs = [ - "10.0.1.1/32" - ]; + allowedIPs = [ + "10.0.1.1/24" + ]; endpoint = "bruynooghe.dev:51820"; - publicKey = "uHP+JhuLp8pcvup6V0LdFyDKsWV3kMD+CeEpqaD8Ag4="; - } + publicKey = "uHP+JhuLp8pcvup6V0LdFyDKsWV3kMD+CeEpqaD8Ag4="; + } ]; privateKey = "0ODqC4gxhLvRy5poqRGOx5wtOmtgN6NatcfsEpcGw1c="; }; }; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + # Shows battery charge of connected devices on supported + # Bluetooth adapters. Defaults to 'false'. + Experimental = true; + # When enabled other devices can connect faster to us, however + # the tradeoff is increased power consumption. Defaults to + # 'false'. + FastConnectable = true; + }; + Policy = { + # Enable all controllers when they are found. This includes + # adapters present on start as well as adapters that are plugged + # in later on. Defaults to 'true'. + AutoEnable = true; + }; + }; + }; + # Set your time zone. time.timeZone = "Europe/Brussels"; @@ -52,44 +80,66 @@ services.xserver.enable = true; services.xserver.enableTCP = true; # Enable the KDE Plasma Desktop Environment. - services.displayManager.sddm.enable = true; services.displayManager.sddm.wayland.enable = true; + services.displayManager.sddm.enable = true; + services.displayManager.sddm.wayland.enable = true; services.desktopManager.plasma6.enable = true; #hyprland - programs.hyprland.enable = true; programs.hyprland.xwayland.enable = true; programs.uwsm.enable = true; - programs.hyprland.withUWSM = true; + programs.hyprland.enable = true; + programs.hyprland.xwayland.enable = true; + #programs.uwsm.enable = true; + #programs.hyprland.withUWSM = true; environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Configure keymap in X11 - services.xserver.xkb = { layout = "us"; variant = ""; + services.xserver.xkb = { + layout = "us"; + variant = ""; }; # Enable CUPS to print documents. services.printing.enable = true; # Enable sound with pipewire. - services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { - enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + services.pulseaudio.enable = false; + 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 + # 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) wireplumber.enable = true; }; # Enable touchpad support (enabled default in most desktopManager). services.xserver.libinput.enable = true; - + ################## ## USERS ################## # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.sarah = { isNormalUser = true; description = "Sarah"; extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ - kdePackages.kate thunderbird rustdesk-flutter - ]; + users.users = let + defaultUser = { + isNormalUser = true; + description = "Default user"; + extraGroups = ["networkmanager" "wheel" "openrazer"]; + packages = with pkgs; [ + kdePackages.kate + thunderbird + rustdesk-flutter + ]; + }; + in { + sarah = defaultUser // {description = "Sarah";}; + emily = defaultUser // {description = "Emily";}; + larra = defaultUser // {description = "Larra";}; + lizzy = defaultUser // {description = "DA GF";}; }; # Allow unfree packages @@ -99,25 +149,88 @@ ################### # List packages installed in system profile. To search, run: $ nix search wget - environment.systemPackages = with pkgs; [ # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget steam alacritty + environment.systemPackages = with pkgs; [ + # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget steam alacritty libva-utils vesktop git - tealdear + tealdeer bat + hyfetch + neofetch + fastfetch + macchina + kitty + hyprpaper + hyprpanel + btop + lm_sensors + liquidctl + polychromatic + openrazer-daemon + vscode-fhs + jetbrains.rust-rover + rustup + rustc + cargo + gcc + vulkan-headers + lld + mold + vulkan-loader + vulkan-headers + alacritty + hyprpanel + krita + fish + wofi + yadm + variety + inputs.zen-browser.packages."${system}".default + kdePackages.kdenlive + obsidian + fish + fishPlugins.done + fishPlugins.fzf-fish + fishPlugins.forgit + fishPlugins.hydro + fzf + fishPlugins.grc + grc + oh-my-posh + pyenv + swww + ags + chromium + gcc + gamescope-wsi + mesa + grimblast + godot + yt-dlp + strawberry + gamemode + xfce.thunar + alejandra + ]; + + fonts.enableDefaultPackages = true; + fonts.packages = with pkgs; [ + nerd-fonts.victor-mono ]; - ################# - ## programs + ## programs ################# - + # STEAM programs.steam = { enable = true; remotePlay.openFirewall = true; localNetworkGameTransfers.openFirewall = true; gamescopeSession.enable = true; + protontricks.enable = true; + protontricks.package = pkgs-stable.protontricks; }; programs.gamescope.enable = true; @@ -127,32 +240,36 @@ programs.neovim.enable = true; programs.git = { enable = true; - user = { + config.user = { name = "Larra Emily Sarah"; email = "larra.vanloon@gmail.com"; }; + config.init.defaultBranch = "main"; }; - # Some programs need SUID wrappers, can be configured further or are started in user sessions. + programs.fish.enable = true; + services.gvfs.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; # }; # List services that you want to enable: - # Enable the OpenSSH daemon. + # Enable the OpenSSH daemon. services.openssh.enable = true; - # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ ... ]; networking.firewall.allowedUDPPorts + # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ ... ]; networking.firewall.allowedUDPPorts # = [ ... ]; Or disable the firewall altogether. networking.firewall.enable = false; ################################# - ## versioning upgrading cleanup + ## versioning upgrading cleanup ################################# - # 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 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 = "25.05"; # Did you read the comment? system.autoUpgrade.enable = true; system.autoUpgrade = { @@ -167,28 +284,33 @@ options = "--delete-older-than 20d"; }; nix.settings.auto-optimise-store = true; - + ############# ### hardware ############# - + # everything amd gpu - hardware.graphics.enable32Bit = true; hardware.graphics.extraPackages = [ + hardware.graphics.enable32Bit = true; + hardware.graphics.extraPackages = [ pkgs.rocmPackages.clr.icd pkgs.libva ]; - - - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelModules = [ "amdgpu" ]; + boot.initrd.kernelModules = ["amdgpu"]; + boot.kernelModules = ["amdgpu"]; hardware.amdgpu.overdrive.ppfeaturemask = "0xffffffff"; services.hardware.openrgb.enable = true; - + hardware.openrazer = { + enable = true; + users = ["sarah"]; + }; + + services.xserver.videoDrivers = ["amdgpu"]; + environment.variables = { SUDO_EDITOR = "nvim"; }; - nix.settings.experimental-features = [ "nix-command" "flakes"]; + nix.settings.experimental-features = ["nix-command" "flakes"]; } diff --git a/flake.lock b/flake.lock index c630f97..dcf70fb 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,33 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "zen-browser", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765682243, + "narHash": "sha256-yeCxFV/905Wr91yKt5zrVvK6O2CVXWRMSrxqlAZnLp0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "58bf3ecb2d0bba7bdf363fc8a6c4d49b4d509d03", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1764517877, - "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=", + "lastModified": 1765472234, + "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c", + "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b", "type": "github" }, "original": { @@ -16,9 +37,48 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1766014764, + "narHash": "sha256-+73VffE5GP5fvbib6Hs1Su6LehG+9UV1Kzs90T2gBLA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2b0d2b456e4e8452cf1c16d00118d145f31160f9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "zen-browser": "zen-browser" + } + }, + "zen-browser": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765764138, + "narHash": "sha256-Nb5y5xSDQLMeUYiA1bQkbmHffGm0d/XXWoJjFu8ovw0=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "bd8815d0a686267386268e7cc70315124e21362b", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index af042f5..930468d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,37 @@ { - description = "A very basic flake"; + description = "LESA OS"; inputs = { + # dafault unstable nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + #latest stable + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.05"; + + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs }: { + outputs = { + self, + nixpkgs, + nixpkgs-stable, + zen-browser, + ... + } @ inputs: { nixosConfigurations.ArcticFox = nixpkgs.lib.nixosSystem { - modules = [ ./configuration.nix ]; + specialArgs = let + system = "x86_64-linux"; + in { + inherit inputs; + pkgs-stable = import nixpkgs-stable { + inherit system; + config.allowUnfree = true; + }; + }; + modules = [./configuration.nix]; }; }; } diff --git a/rebuild.sh b/rebuild.sh new file mode 100755 index 0000000..3e5f9d7 --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -e + +if git diff --quiet '*.nix'; then + echo "No changes detected, exiting" + popd + exit 0 +fi + +alejandra . &>/dev/null || + ( + alejandra . + echo "formatting failed!" && exit 1 + ) + +git diff -U0 '*.nix' + +echo "NixOS rebuilding..." + +sudo nixos-rebuild switch --impure --flake . &>nixos-switch.log || (cat nixos-switch.log | grep --color error && exit 1) + +current=$(nixos-rebuild list-generations | grep current) + +git commit -am "$current" + +popd + +notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available