diff --git a/flake.lock b/flake.lock index 69831fed..fbda5aaf 100644 --- a/flake.lock +++ b/flake.lock @@ -98,12 +98,28 @@ "type": "github" } }, + "nur": { + "locked": { + "lastModified": 1656516558, + "narHash": "sha256-xMfUEwRG1ty4YysAl0BNlHbdLPxbi8cCFmCOTt4JLFA=", + "owner": "nix-community", + "repo": "NUR", + "rev": "e86ce90db1b2ee55ba412845161c063dff3301db", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "root": { "inputs": { "emacs-overlay": "emacs-overlay", "hardware": "hardware", "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "nur": "nur" } }, "utils": { diff --git a/flake.nix b/flake.nix index 0aa1a3cb..a53b8d5a 100644 --- a/flake.nix +++ b/flake.nix @@ -23,10 +23,11 @@ # Outputs is a function that takes the inputs as arguments. # To handle extra arguments we use the inputs@ pattern. # It gives a name to the ... ellipses. - outputs = inputs @ { nixpkgs, home-manager, ... }: + outputs = inputs @ { nixpkgs, home-manager, emacs-overlay, nur, ... }: # With let you can define local variables let # We bring these functions into the scope for the outputs. + inherit (builtins) attrValues; inherit (nixpkgs.lib) nixosSystem; inherit (home-manager.lib) homeManagerConfiguration; in @@ -49,7 +50,13 @@ system = "x86_64-linux"; # >> Main NixOS configuration file << - modules = [ ./nixos/configuration.nix ]; + modules = [ + # TODO: Modularize + ./nixos/configuration.nix + + # Add the overlays + { nixpkgs.overlays = attrValues overlays; } + ]; # Make our inputs available to the config (for importing modules) specialArgs = { inherit inputs; }; @@ -68,12 +75,17 @@ modules = [ # >> Main HomeManager configuration file << ./home/home.nix + { home = rec { username = "christoph"; homeDirectory = "/home/${username}"; stateVersion = "22.05"; }; + + # Add the overlays + # TODO: This is wrong, I need to figure out nur when I try out gamescope + # nixpkgs.overlays = attrValues overlays; } ]; diff --git a/home/home.nix b/home/home.nix index 48616505..4550b14f 100644 --- a/home/home.nix +++ b/home/home.nix @@ -9,14 +9,13 @@ # Feel free to split up your configuration and import pieces of it here. ]; - # Comment out if you wish to disable Unfree packages for your system - nixpkgs.config.allowUnfree = true; # https://github.com/nix-community/home-manager/issues/2942 nixpkgs.config.allowUnfreePredicate = (pkg: true); + nixpkgs.config.allowUnfree = true; # Chinese Input i18n.inputMethod.enabled = "fcitx5"; - i18n.inputMethod.fcitx5.addons = with pkgs; [ fcitx5-gtk libsForQt5.fcitx5-qt fcitx5-chinese-addons fctix5-configtool ] + i18n.inputMethod.fcitx5.addons = with pkgs; [ fcitx5-gtk libsForQt5.fcitx5-qt fcitx5-chinese-addons fcitx5-configtool ]; # Packages with extra options managed by HomeManager natively programs = { @@ -30,10 +29,17 @@ direnv = { enable = true; - # enableFishIntegration = true; # Deprecated nix-direnv.enable = true; }; + # TODO: Move to emacs module + emacs = { + # TODO: This is wrong, I need to figure out the overlays + # package = pkgs.emacsPgtkNativeComp; + package = pkgs.emacs28NativeComp; + enable = true; + }; + exa.enable = true; feh.enable = true; @@ -123,7 +129,8 @@ # Doom Emacs # TODO: Make module out of this - emacs.emacsPgtkNativeComp + binutils + zstd ripgrep fd gcc @@ -175,7 +182,7 @@ papirus-icon-theme # Fonts - # TODO: Make a module + # TODO: Make a module and move to fonts.fonts or something more specific victor-mono source-code-pro source-sans-pro @@ -205,7 +212,8 @@ # Gaming gamemode - nur.gamescope + # TODO: This is wrong, I need to figure out nur when I try out gamescope + # pkgs.repos.dukzcry.gamescope steam polymc lutris diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 012a51d9..f33eb766 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -92,12 +92,21 @@ # Enable the X11 windowing system. services.xserver.enable = true; - # Enable the KDE Plasma Desktop Environment. + # Proprietary graphics drivers services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia.modesetting.enable = true; # Not officially supported by NVidia - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; - services.xserver.desktopManager.plasma5.runUsingSystemd = true; + + # Startx replaces the displaymanager so default (lightdm) isn't used, start to shell + # services.xserver.displayManager.startx.enable = true; + + # Plasma (X11) + # services.xserver.displayManager.sddm.enable = true; + # services.xserver.desktopManager.plasma5.enable = true; + # services.xserver.desktopManager.plasma5.runUsingSystemd = true; + + # Gnome (Wayland) + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; # Configure keymap in X11 services.xserver = { @@ -106,8 +115,8 @@ }; # Enable CUPS to print documents. - services.printing.enable = true; # TODO: Printer driver + services.printing.enable = true; services.avahi.enable = true; # Network printers services.avahi.nssmdns = true; hardware.sane.enable = true; # Scanning @@ -146,6 +155,7 @@ nixpkgs.config.allowUnfree = true; # Use all redistributable firmware (i.e. nonfree) + hardware.enableAllFirmware = true; hardware.enableRedistributableFirmware = true; # We want these packages to be available even when no user profile is active @@ -199,20 +209,10 @@ # TODO: Other ports (tcp/udp/ssh...)? # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ ]; - networking.firewall.allowedTCPPortRanges = [ - { # KDEConnect - from = 1714; - to = 1764; - } - ]; + networking.firewall.allowedTCPPortRanges = []; networking.firewall.allowedUDPPorts = [ ]; - networking.firewall.allowedUDPPortRanges = [ - { # KDEConnect - from = 1714; - to = 1764; - } - ]; + networking.firewall.allowedUDPPortRanges = []; # Or disable the firewall altogether. # networking.firewall.enable = false;