diff --git a/README.md b/README.md index 2ccfe98..296b7f1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # nixos-dotfiles -dotfiles for nixos \ No newline at end of file +dotfiles for nixos + +referenced heavily on [librephoenix's nixos-config](https://github.com/librephoenix/nixos-config). diff --git a/flake.lock b/flake.lock index 7a3eb56..6c252ef 100644 --- a/flake.lock +++ b/flake.lock @@ -7,16 +7,16 @@ ] }, "locked": { - "lastModified": 1720042825, - "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", + "lastModified": 1723399884, + "narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", "owner": "nix-community", "repo": "home-manager", - "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", + "rev": "086f619dd991a4d355c07837448244029fc2d9ab", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.05", + "ref": "master", "repo": "home-manager", "type": "github" } @@ -39,18 +39,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723282977, - "narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=", - "owner": "nixos", + "lastModified": 1723362943, + "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc", + "rev": "a58bc8ad779655e790115244571758e8de055e3d", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" } }, "root": { diff --git a/flake.nix b/flake.nix index 30d8819..b697192 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ description = "kenryuS nixos configurations/dotfiles"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05"; - home-manager.url = "github:nix-community/home-manager/release-24.05"; + nixpkgs.url = "nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; @@ -37,7 +37,7 @@ system = systemSettings.system; config = { allowUnfree = true; - allowUnfreePredicate = (_: true); + allowUnfreePredicate = (_: true ); }; }; diff --git a/machines/base.nix b/machines/base.nix index 6a4a5b5..d467993 100644 --- a/machines/base.nix +++ b/machines/base.nix @@ -13,6 +13,8 @@ nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nixpkgs.config.allowUnfree = true; + i18n.defaultLocale = systemSettings.locale; i18n.extraLocaleSettings = { LC_ADDRESS = systemSettings.locale; diff --git a/machines/workstation/configuration.nix b/machines/workstation/configuration.nix index c4312e8..96083b5 100644 --- a/machines/workstation/configuration.nix +++ b/machines/workstation/configuration.nix @@ -1,7 +1,3 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - { config, lib, pkgs, ... }: { @@ -11,41 +7,25 @@ ../base.nix ../../system/services/cups.nix ../../system/services/ssh.nix + ../../system/services/polkit.nix ../../system/hardware/kernel.nix + ../../system/hardware/nvidia.nix + ../../system/hardware/opengl.nix + ../../system/hardware/bluetooth.nix + ../../system/wm/sddm.nix ]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # Configure keymap in X11 - # services.xserver.xkb.layout = "us"; - # services.xserver.xkb.options = "eurosign:e,caps:escape"; - # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. # networking.firewall.enable = false; - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how - # to actually do that. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "24.05"; # Did you read the comment? + system.stateVersion = "24.05"; # Did you read the changelog? } diff --git a/system/hardware/audio.nix b/system/hardware/audio.nix index 0947c5d..fa3ebc3 100644 --- a/system/hardware/audio.nix +++ b/system/hardware/audio.nix @@ -1,4 +1,13 @@ { ... }: { - hardware.pulseaudio.enable = true; + #hardware.pulseaudio.enable = true; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; } diff --git a/system/hardware/nvidia.nix b/system/hardware/nvidia.nix new file mode 100644 index 0000000..723f556 --- /dev/null +++ b/system/hardware/nvidia.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: +{ + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + }; +} diff --git a/system/services/polkit.nix b/system/services/polkit.nix new file mode 100644 index 0000000..67de2bd --- /dev/null +++ b/system/services/polkit.nix @@ -0,0 +1,4 @@ +{ pkgs, lib, config, ... }: +{ + security.polkit.enable = true; +} diff --git a/system/wm/dbus.nix b/system/wm/dbus.nix new file mode 100644 index 0000000..0f0ac1c --- /dev/null +++ b/system/wm/dbus.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + services.dbus = { + enable = true; + packages = [ pkgs.dconf ]; + }; + + programs.dconf.enable = true; +} diff --git a/system/wm/fonts.nix b/system/wm/fonts.nix new file mode 100644 index 0000000..af9828e --- /dev/null +++ b/system/wm/fonts.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + fonts.packages = with pkgs; [ + _0xproto + ipafont + takao + ]; +} diff --git a/system/wm/gnome-keyring.nix b/system/wm/gnome-keyring.nix new file mode 100644 index 0000000..081985c --- /dev/null +++ b/system/wm/gnome-keyring.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.gnome.gnome-keyring.enable = true; +} diff --git a/system/wm/sddm.nix b/system/wm/sddm.nix new file mode 100644 index 0000000..943a980 --- /dev/null +++ b/system/wm/sddm.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: +{ + imports = [ + ./fonts.nix + ./dbus.nix + ./gnome-keyring.nix + ./xmonad.nix + ./sway.nix + ]; + + environment.systemPackages = with pkgs; [ + wayland + ]; + + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + package = pkgs.sddm; + }; + + services.xserver = { + enable = true; + xkb = { + layout = "us"; + variant = ""; + options = ""; + }; + excludePackages = [ pkgs.xterm ]; + }; +} diff --git a/system/wm/sway.nix b/system/wm/sway.nix new file mode 100644 index 0000000..2ba9541 --- /dev/null +++ b/system/wm/sway.nix @@ -0,0 +1,12 @@ +{ pkgs, lib, config, ... }: +{ + imports = [ + ./gnome-keyring.nix + ./dbus.nix + ]; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; +} diff --git a/system/wm/x11.nix b/system/wm/x11.nix new file mode 100644 index 0000000..755dd52 --- /dev/null +++ b/system/wm/x11.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + imports = [ + ./fonts.nix + ./dbus.nix + ./gnome-keyring.nix + ]; + + services.xserver = { + enable = true; + layout = "us"; + xkbVariant = ""; + xkbOptions = ""; + excludePackages = [ pkgs.xterm ]; + displayManager.sddm = { + enable = true; + wayland.enable = false; + package = pkgs.sddm; + }; + }; +} diff --git a/system/wm/xmonad.nix b/system/wm/xmonad.nix new file mode 100644 index 0000000..67cb40a --- /dev/null +++ b/system/wm/xmonad.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services.xserver.windowManager.xmonad = { + enable = true; + enableContribAndExtras = true; + }; +}