From ffc95db1f87d80aee432537dabf3269d335a1b4c Mon Sep 17 00:00:00 2001 From: Sneexy Date: Wed, 17 Apr 2024 20:52:32 -0500 Subject: [PATCH] refactor: attempting to merge nix-starter-configs and chfour's nixos config together --- config/common.nix | 98 --------- config/packages.nix | 33 --- config/plasma.nix | 42 ---- flake.nix | 35 +++- {users/ruben => home-manager}/home.nix | 45 ++-- machines/thonkpad/default.nix | 18 +- machines/thunkpad/default.nix | 16 -- modules/home-manager/default.nix | 6 + modules/nixos/default.nix | 6 + nixos/configuration.nix | 228 +++++++++++++++++++++ users/ruben/default.nix => nixos/users.nix | 3 +- overlays/default.nix | 23 +++ pkgs/default.nix | 5 + 13 files changed, 330 insertions(+), 228 deletions(-) delete mode 100644 config/common.nix delete mode 100644 config/packages.nix delete mode 100644 config/plasma.nix rename {users/ruben => home-manager}/home.nix (75%) create mode 100644 modules/home-manager/default.nix create mode 100644 modules/nixos/default.nix create mode 100644 nixos/configuration.nix rename users/ruben/default.nix => nixos/users.nix (93%) create mode 100644 overlays/default.nix create mode 100644 pkgs/default.nix diff --git a/config/common.nix b/config/common.nix deleted file mode 100644 index 450630e..0000000 --- a/config/common.nix +++ /dev/null @@ -1,98 +0,0 @@ -{ config, pkgs, ... }: - -{ - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # auto optimize store and experimental features - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; - }; - - # Enable networking - networking.networkmanager.enable = true; - - # we're using/prioritizing dnscrypt! - networking.nameservers = [ "127.0.0.1" "::1" ]; - # resolved and others conflicts with setting dns here - networking.resolvconf.enable = pkgs.lib.mkForce false; - networking.dhcpcd.extraConfig = "nohook resolv.conf"; - services.resolved.enable = false; - # also ensuring that networkmanager doesn't modify dns settings - networking.networkmanager.dns = "none"; - - # dnscrypt settings - services.dnscrypt-proxy2 = { - enable = true; - settings = { - ipv6_servers = true; - require_dnssec = true; - - sources.public-resolvers = { - # of course, sourcing from the main public lists - urls = [ - "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md" - "https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md" - ]; - cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md"; - minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; - }; - - # You can choose a specific set of servers from https://github.com/DNSCrypt/dnscrypt-resolvers/blob/master/v3/public-resolvers.md - # prioritize quad9, then adguard, and cloudflare as last resort - server_names = [ "quad9-dnscrypt-ip4-filter-pri" "quad9-doh-ip4-port443-filter-pri" "quad9-doh-ip6-port443-filter-pri" "adguard-dns-doh" "adguard-dns-ipv6" "cloudflare" "cloudflare-ipv6" ]; - }; - }; - - systemd.services.dnscrypt-proxy2.serviceConfig = { - StateDirectory = "dnscrypt-proxy"; - }; - - # enable plymouth because it looks cool :))) - boot.plymouth = { - enable = true; - theme = "bgrt"; - }; - - # Enable CUPS to print documents. - services.printing = { - enable = true; - drivers = with pkgs; [ canon-cups-ufr2 ]; - }; - services.avahi.enable = true; - services.avahi.nssmdns4 = true; - - # Enable sound with pipewire. - sound.enable = true; - hardware.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; - - # wireplumber exists so, lets *not* use the example session - wireplumber.enable = true; - }; - - # gnupg is basically required for everything i use - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - # virtualization stuff - virtualisation.libvirtd = { - enable = true; - #qemu.runAsRoot = false; - qemu.swtpm.enable = true; - }; - virtualisation.spiceUSBRedirection.enable = true; - - # waydroid - virtualisation.waydroid.enable = true; -} diff --git a/config/packages.nix b/config/packages.nix deleted file mode 100644 index 2895ce1..0000000 --- a/config/packages.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, pkgs, ... }: - -{ - # List packages installed in system profile. To search, run: - # $ nix search wget - # - # enable flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - environment.systemPackages = with pkgs; [ - # git is required for flakes, and either way i use it - git - wget - curl - jq - imagemagick - ffmpeg - - virt-manager - ]; - # set the default editor to neovim - environment.variables.EDITOR = "nvim"; - - # we like flatpaks - services.flatpak.enable = true; - - # steam - programs.steam = { - enable = true; - }; - - # android debugging tools - programs.adb.enable = true; -} diff --git a/config/plasma.nix b/config/plasma.nix deleted file mode 100644 index 4c58232..0000000 --- a/config/plasma.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ pkgs, ... }: - -{ - # so, funny thing i learned - "xserver" is basically the blanket term for all gui stuff in nixos. - # this really confuses me, because i'm trying to keep xorg out of this install and only wayland in. - # i may miss some spots though. - # see: https://www.reddit.com/r/NixOS/comments/17ia1g8/i_dont_understand_nixoss_wayland_setup/ - - services.xserver.enable = true; - - # use sddm and only use its wayland session - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - # default to plasma wayland session - services.displayManager.defaultSession = "plasma"; - # gyattde rizzma 6 - services.desktopManager.plasma6 = { - enable = true; - }; - - programs.xwayland.enable = true; - # we use flatpak - programs.firefox.enable = false; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - }; - - # don't install some of the default packages since i don't need them - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - plasma-browser-integration - #konsole - #oxygen - ]; - - # ensure we have dconf enabled - programs.dconf.enable = true; - - # this enables the ozone stuff on wayland for chromium and electron and shit - environment.variables.NIXOS_OZONE_WL = "1"; -} diff --git a/flake.nix b/flake.nix index 56e9cdb..9c13971 100644 --- a/flake.nix +++ b/flake.nix @@ -3,9 +3,9 @@ # | '_ \| \ \/ / _ \/ __| # | | | | |> < (_) \__ \ # |_| |_|_/_/\_\___/|___/ -# this configuration file is copied/inspired from https://github.com/chfour/nixos -# with lots of examples and knowledge gained with the standard config from https://github.com/Misterio77/nix-starter-configs -# and also this wonderful book https://nixos-and-flakes.thiscute.world +# this configuration file is basically a mashup of https://github.com/chfour/nixos and https://github.com/Misterio77/nix-starter-configs +# with lots of examples and knowledge gained from both of them +# and also this wonderful book which helped get me started on nix https://nixos-and-flakes.thiscute.world # shoutouts to yall 🙏 { description = "Sneexy's custom nixos configs"; @@ -37,6 +37,7 @@ # flake for 06cb:009a fingerprint scanners. to make the fingerprint scanner on my # thinkpad t480 function. + # TODO: see if you can only add this for t480 nixos-06cb-009a-fingerprint-sensor = { url = "github:ahbnr/nixos-06cb-009a-fingerprint-sensor"; inputs.nixpkgs.follows = "nixpkgs"; @@ -66,15 +67,33 @@ # pass to it, with each system as an argument forAllSystems = nixpkgs.lib.genAttrs systems; in { + # Your custom packages + # Accessible through 'nix build', 'nix shell', etc + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + # Formatter for your nix files, available through 'nix fmt' + # Other options beside 'alejandra' include 'nixpkgs-fmt' + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); + + # Your custom packages and modifications, exported as overlays + overlays = import ./overlays {inherit inputs;}; + # Reusable nixos modules you might want to export + # These are usually stuff you would upstream into nixpkgs + nixosModules = import ./modules/nixos; + # Reusable home-manager modules you might want to export + # These are usually stuff you would upstream into home-manager + homeManagerModules = import ./modules/home-manager; + # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' nixosConfigurations = { # main laptop i use daily "thunkpad" = nixpkgs.lib.nixosSystem rec { specialArgs = {inherit inputs outputs;}; - modules = with self.nixosModules; [ - # nixos configuration file (and others) for thunkpad + modules = [ + # specific configs for thunkpad/t480 ./machines/thunkpad + # shared/common config + ./nixos/configuration.nix # fingerprint modules nixos-06cb-009a-fingerprint-sensor.nixosModules.open-fprintd nixos-06cb-009a-fingerprint-sensor.nixosModules.python-validity @@ -84,10 +103,12 @@ }; # secondary 2 in 1 device, not really used "thonkpad" = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = with self.nixosModules; [ + specialArgs = {inherit inputs outputs;}; + modules = [ # nixos configuration file (and others) for thonkpad ./machines/thonkpad + # shared/common config + ./nixos/configuration.nix # nyx repo chaotic.nixosModules.default ]; diff --git a/users/ruben/home.nix b/home-manager/home.nix similarity index 75% rename from users/ruben/home.nix rename to home-manager/home.nix index 77b0238..2fb6e22 100644 --- a/users/ruben/home.nix +++ b/home-manager/home.nix @@ -4,7 +4,6 @@ inputs, outputs, lib, - osConfig, config, pkgs, ... @@ -22,6 +21,23 @@ ]; nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; # Configure your nixpkgs instance config = { # Disable if you don't want unfree packages @@ -31,14 +47,12 @@ }; }; - # meeee :333 - # if this ain't you, you should probably change this home = { username = "ruben"; homeDirectory = "/home/ruben"; }; - # this is a got damn NEO VIMME HOUSE !! + # this is a got damn NEO VIMME HOUSE !! home.sessionVariables = { EDITOR = "nvim"; }; @@ -75,6 +89,7 @@ xdg.userDirs.enable = true; + # music!! services.mpd = { enable = true; extraConfig = '' @@ -86,31 +101,33 @@ }; # Add stuff for your user as you see fit: - # programs.neovim.enable = true; + programs.neovim.enable = true; home.packages = with pkgs; [ btop - sheldon - starship - zoxide - fzf bat duf + fastfetch fd delta lsd ripgrep sd + starship + zoxide + usbutils + jq + ffmpeg_6-full + imagemagick yt-dlp + mpv ]; - # Enable home-manager and git - programs.home-manager.enable = true; - programs.git.enable = true; - # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; + # Enable home-manager + programs.home-manager.enable = true; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - # basically: don't touch this. home.stateVersion = "23.05"; } diff --git a/machines/thonkpad/default.nix b/machines/thonkpad/default.nix index 1354a80..741c2f5 100644 --- a/machines/thonkpad/default.nix +++ b/machines/thonkpad/default.nix @@ -8,27 +8,11 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - # KDE Plasma configuration - ../../config/plasma.nix - # Shared/common configurations - ../../config/common.nix - # Packages - ../../config/packages.nix ]; - # who up thunking they + # who up thonking they networking.hostName = "thonkpad"; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # use linux-cachy from the nyx repo. - # is this actually "required"? no, not really. but i can have it, so why not? - # see nyx: https://www.nyx.chaotic.cx/ - # see cachyos: https://github.com/CachyOS/linux-cachyos - boot.kernelPackages = pkgs.linuxPackages_cachyos; - # Set your time zone. time.timeZone = "America/Chicago"; diff --git a/machines/thunkpad/default.nix b/machines/thunkpad/default.nix index b704bcd..e381da2 100644 --- a/machines/thunkpad/default.nix +++ b/machines/thunkpad/default.nix @@ -8,27 +8,11 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - # KDE Plasma configuration - ../../config/plasma.nix - # Shared/common configurations - ../../config/common.nix - # Packages - ../../config/packages.nix ]; # who up thunking they networking.hostName = "thunkpad"; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # use linux-cachy from the nyx repo. - # is this actually "required"? no, not really. but i can have it, so why not? - # see nyx: https://www.nyx.chaotic.cx/ - # see cachyos: https://github.com/CachyOS/linux-cachyos - boot.kernelPackages = pkgs.linuxPackages_cachyos; - # Set your time zone. time.timeZone = "America/Chicago"; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..45aae31 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,6 @@ +# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..8605069 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,6 @@ +# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..cebce81 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,228 @@ +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + # You can import other NixOS modules here + imports = [ + # If you want to use modules your own flake exports (from modules/nixos): + # outputs.nixosModules.example + + # Or modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + + # You can also split up your configuration and import pieces of it here: + # ./users.nix + + # specify users in a seperate config file (since its only me on this system, anyways) + ./users.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nix.nixPath = ["/etc/nix/path"]; + environment.etc = + lib.mapAttrs' + (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + }) + config.nix.registry; + + nix.settings = { + # Enable flakes and new 'nix' command + experimental-features = "nix-command flakes"; + # Deduplicate and optimize nix store + auto-optimise-store = true; + }; + + # use linux-cachy from the nyx repo. + # is this actually "required"? no, not really. but i can have it, so why not? + # see nyx: https://www.nyx.chaotic.cx/ + # see cachyos: https://github.com/CachyOS/linux-cachyos + boot.kernelPackages = pkgs.linuxPackages_cachyos; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Enable networking + networking.networkmanager.enable = true; + + # we're using/prioritizing dnscrypt! + networking.nameservers = [ "127.0.0.1" "::1" ]; + # resolved and others conflicts with setting dns here + networking.resolvconf.enable = pkgs.lib.mkForce false; + networking.dhcpcd.extraConfig = "nohook resolv.conf"; + services.resolved.enable = false; + # also ensuring that networkmanager doesn't modify dns settings + networking.networkmanager.dns = "none"; + + # dnscrypt settings + services.dnscrypt-proxy2 = { + enable = true; + settings = { + ipv6_servers = true; + require_dnssec = true; + + sources.public-resolvers = { + # of course, sourcing from the main public lists + urls = [ + "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md" + "https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md" + ]; + cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md"; + minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; + }; + + # You can choose a specific set of servers from https://github.com/DNSCrypt/dnscrypt-resolvers/blob/master/v3/public-resolvers.md + # prioritize quad9, then adguard, and cloudflare as last resort + server_names = [ "quad9-dnscrypt-ip4-filter-pri" "quad9-doh-ip4-port443-filter-pri" "quad9-doh-ip6-port443-filter-pri" "adguard-dns-doh" "adguard-dns-ipv6" "cloudflare" "cloudflare-ipv6" ]; + }; + }; + + systemd.services.dnscrypt-proxy2.serviceConfig = { + StateDirectory = "dnscrypt-proxy"; + }; + + # enable plymouth because it looks cool :))) + boot.plymouth = { + enable = true; + theme = "bgrt"; + }; + + # Enable CUPS to print documents. + services.printing = { + enable = true; + drivers = with pkgs; [ canon-cups-ufr2 ]; + }; + services.avahi.enable = true; + services.avahi.nssmdns4 = true; + + # so, funny thing i learned - "xserver" is basically the blanket term for all gui stuff in nixos. + # this really confuses me, because i'm trying to keep xorg out of this install and only wayland in. + # i may miss some spots though. + # see: https://www.reddit.com/r/NixOS/comments/17ia1g8/i_dont_understand_nixoss_wayland_setup/ + # EDIT: they changed it !!!! + + services.xserver.enable = true; + + # use sddm and only use its wayland session + services.displayManager.sddm.enable = true; + services.displayManager.sddm.wayland.enable = true; + # default to plasma wayland session + services.displayManager.defaultSession = "plasma"; + # gyattde rizzma 6 + services.desktopManager.plasma6 = { + enable = true; + }; + + programs.xwayland.enable = true; + # we use flatpak + programs.firefox.enable = false; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + }; + + # don't install some of the default packages since i don't need them + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + plasma-browser-integration + #konsole + #oxygen + ]; + + # this enables the ozone stuff on wayland for chromium and electron and shit + environment.variables.NIXOS_OZONE_WL = "1"; + + # Enable sound with pipewire. + sound.enable = true; + hardware.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; + + # wireplumber exists so, lets *not* use the example session + wireplumber.enable = true; + }; + + environment.systemPackages = with pkgs; [ + git + wget fzf + curl curlHTTP3 + virt-manager + pinentry-curses + kitty wezterm + ventoy + ]; + + # we like flatpaks + services.flatpak.enable = true; + + # steam + programs.steam.enable = true; + + # android debugging tools + programs.adb.enable = true; + + # gnupg is basically required for everything i use + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + # virtualization stuff + virtualisation.libvirtd = { + enable = true; + #qemu.runAsRoot = false; + qemu.swtpm.enable = true; + }; + virtualisation.spiceUSBRedirection.enable = true; + + # waydroid + virtualisation.waydroid.enable = true; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.05"; +} diff --git a/users/ruben/default.nix b/nixos/users.nix similarity index 93% rename from users/ruben/default.nix rename to nixos/users.nix index 90e8bcf..5f3b07c 100644 --- a/users/ruben/default.nix +++ b/nixos/users.nix @@ -4,6 +4,7 @@ { home-manager.users.ruben = ./home.nix; + # myself :D users.users."ruben" = { isNormalUser = true; description = "Ruben"; @@ -13,6 +14,6 @@ openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO+V3b6oKMTLEBq8AKjdNF5ZwJGXuWTrS2u9QaEypBYP sneexy@disroot.org'' ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCtpoR3fGHuHv55u1rhY4YVm4rz49/i78IQa3Lv7GsaJXse5nswkBW2fl4zXjBOorKBLPDBqgYZDFOxbjXTQq+zTrEN3qggp5W1kQXMuTqh3iyaseavwt7FM70IziAOkfYyJdAvLsoBymFLLXnVSYY5ZdxiRK6S+1ud64OAw2/wigk5KxPEjnL1Q8a9S1xpCWLVBNNTL0qYneFezHApN3lijeotcBVYhpQmxtifebeeom0J7KE3ivYW/mh7tTk2DZVAQPRKPC1Szk2TdWuUw8i5Ybdjc8lSNgDHBFzGexxIDeRJMaaQP5wDdTxIrIWAIXREkOd4soijaK09bRD4d4Xi6qeCRWoARrsyEzWASpXpNN7yVta6JVe1r+QdNYFol9K0ojqQHsjYJpskTpBCXCLlmQCzRcAuAyf9Poj+l3Z8L65/T7Mucm5+/3Z3HQK99sDx0i4NmueBiDrkdm159K8w/iG08d9H4kD0wu1RAaIzCkKENF/LS9Ut207w0qbwak= ruben@thunkpad'' ]; }; - programs.zsh.enable = true; # "TODO: get rid of this if possible" thanks chfour + programs.zsh.enable = true; environment.shells = with pkgs; [ zsh ]; } diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..a13ea3c --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,23 @@ +# This file defines overlays +{inputs, ...}: { + # This one brings our custom packages from the 'pkgs' directory + additions = final: _prev: import ../pkgs {pkgs = final;}; + + # This one contains whatever you want to overlay + # You can change versions, add patches, set compilation flags, anything really. + # https://nixos.wiki/wiki/Overlays + modifications = final: prev: { + # example = prev.example.overrideAttrs (oldAttrs: rec { + # ... + # }); + }; + + # When applied, the unstable nixpkgs set (declared in the flake inputs) will + # be accessible through 'pkgs.unstable' + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..3d9e23c --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,5 @@ +# Custom packages, that can be defined similarly to ones from nixpkgs +# You can build them using 'nix build .#example' +pkgs: { + # example = pkgs.callPackage ./example { }; +}