{ inputs = { nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; nixos-hardware = { url = "github:NixOS/nixos-hardware/master"; }; nur = { url = "github:nix-community/NUR"; inputs.nixpkgs.follows = "nixpkgs"; }; #chaotic = { # url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; #}; camu = { url = "git+https://git.akon.city/camu"; inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; inputs.nixos-hardware.follows = "nixos-hardware"; }; mauri = { url = "git+https://git.akon.city/mauri"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, nixos-hardware, home-manager, nur, camu, mauri }: let local-fonts = { name = "Local Fonts"; src = ./../files/fonts; installPhase = '' mkdir -p $out/share/fonts/local cp * $out/share/fonts/local ''; }; optimizeWithFlags = (pkg: flags: pkg.overrideAttrs (oldAttrs: { env.NIX_CFLAGS_COMPILE = (oldAttrs.env.NIX_CFLAGS_COMPILE or "") + " ${flags}"; }) ); in { settingsModule = { lib, ... }: with lib; let fontSettings = types.submodule { options = { name = mkOption { type = types.str; }; size = mkOption { type = types.int; }; baseline = mkOption { type = types.int; }; cell-height-offset = mkOption { type = types.int; }; }; }; scriptSettings = types.submodule { options = { imports = mkOption { type = types.listOf types.str; }; }; }; themeSettings = types.submodule { options = { lightness = mkOption { type = types.str; }; # light/dark background = mkOption { type = types.str; }; background-alt = mkOption { type = types.str; }; # solid color wallpaper foreground = mkOption { type = types.str; }; # bright black and white should be different from black and white. color0 = mkOption { type = types.str; }; # black color1 = mkOption { type = types.str; }; # red color2 = mkOption { type = types.str; }; # green color3 = mkOption { type = types.str; }; # yellow color4 = mkOption { type = types.str; }; # blue color5 = mkOption { type = types.str; }; # magenta color6 = mkOption { type = types.str; }; # cyan color7 = mkOption { type = types.str; }; # white color8 = mkOption { type = types.str; }; # bright black color9 = mkOption { type = types.str; }; # bright red color10 = mkOption { type = types.str; }; # bright green color11 = mkOption { type = types.str; }; # bright yellow color12 = mkOption { type = types.str; }; # bright blue color13 = mkOption { type = types.str; }; # bright magenta color14 = mkOption { type = types.str; }; # bright cyan color15 = mkOption { type = types.str; }; # bright white alpha = mkOption { type = types.float; }; }; }; starterPadSettings = types.submodule { options = { left = mkOption { type = types.int; }; top = mkOption { type = types.int; }; text = mkOption { type = types.int; }; }; }; starterSettings = types.submodule { options = { top_padding = mkOption { type = types.int; }; picture = mkOption { type = types.path; }; width = mkOption { type = types.int; }; padding = mkOption { type = starterPadSettings; }; position = mkOption { type = types.str; }; header = mkOption { type = types.str; }; footer = mkOption { type = types.str; }; footer-offset = mkOption { type = types.int; }; }; }; monitorSettings = types.submodule { options = { monitor1 = mkOption { type = types.str; }; monitor2 = mkOption { type = types.str; }; monitor3 = mkOption { type = types.str; }; }; }; in { options.local = { font = mkOption { type = fontSettings; }; ui-font = mkOption { type = fontSettings; }; emoji-font = mkOption { type = fontSettings; }; scripts = mkOption { type = scriptSettings; }; scheme = mkOption { type = themeSettings; }; starter = mkOption { type = starterSettings; }; monitors = mkOption { type = monitorSettings; }; }; }; nixosConfigurations.sofue = let system = "x86_64-linux"; source-pkgs = nixpkgs.legacyPackages.${system}; nixpkgs-patched = source-pkgs.applyPatches { name = "nixpkgs-patched"; src = nixpkgs; patches = []; }; nixosSystem = import (nixpkgs-patched + "/nixos/lib/eval-config.nix"); in nixosSystem { system = system; modules = [ self.settingsModule ({ lib, ... }: { nixpkgs.overlays = [ nur.overlays.default (self: super: { asNeeded = (pkg: commands: (lib.lists.forEach commands (command: super.writeShellScriptBin "${command}" '' install-as-needed "${pkg}" ${command} "$@" '')) ); }) (self: super: { local-fonts = super.stdenv.mkDerivation local-fonts; }) (self: super: { camu = camu.packages.${system}.default; camu-devshell = camu.packages.${system}.shellWrapper; }) (self: super: { mauri = mauri.packages.${system}.default; }) (self: super: { mpv-unwrapped = super.mpv-unwrapped.override { cddaSupport = true; }; }) (self: super: { mesa = (optimizeWithFlags super.mesa "-O3 -march=znver2 -mtune=znver2 -fno-semantic-interposition").overrideAttrs (oldAttrs: { patches = oldAttrs.patches ++ [ ]; }); }) (self: super: { mesa_git = (optimizeWithFlags super.mesa_git "-O3 -march=znver2 -mtune=znver2 -fno-semantic-interposition").overrideAttrs (oldAttrs: { patches = oldAttrs.patches ++ [ ]; }); }) (self: super: { kitty = (optimizeWithFlags super.kitty "-O3 -march=znver2 -mtune=znver2 -fno-semantic-interposition").overrideAttrs (oldAttrs: { patches = oldAttrs.patches ++ [ ]; }); }) (self: super: { adw-gtk3 = super.adw-gtk3.overrideAttrs (oldAttrs: { patches = [ ../files/patches/adw-gtk3-non-blue-accent.diff ]; }); }) (self: super: { neovim-unwrapped = (optimizeWithFlags super.neovim-unwrapped "-O3 -march=znver2 -mtune=znver2 -fno-semantic-interposition -flto"); }) (self: super: { gamescope = super.gamescope.overrideAttrs (oldAttrs: { patches = oldAttrs.patches ++ [ ./files/gamescope_1826.diff ]; }); }) #(self: super: { # sway-unwrapped = super.sway-unwrapped.overrideAttrs (oldAttrs: { # patches = oldAttrs.patches ++ [ # ./files/sway_background_covered.diff # ]; # }); #}) (self: super: { python = super.python.override ({ packageOverrides = (python-self: python-super: { }); }); }) (self: super: { vimPlugins = super.vimPlugins.extend (final: prev: { mini-nvim = prev.mini-nvim.overrideAttrs (oldAttrs: { patches = [ ./files/nvim/mini_starter_picture.diff ./files/nvim/mini_completion_no_title.diff ]; }); fzf-vim = prev.fzf-vim.overrideAttrs (oldAttrs: { patches = [ ./files/nvim/fzf_no_linenum.diff ]; }); }); }) (self: super: { dia = super.dia.overrideAttrs (oldAttrs: { nativeBuildInputs = with super; [ gobject-introspection python3.pkgs.wrapPython ] ++ old.nativeBuildInputs; pythonPath = with super.python3.pkgs; [ pygobject3 ]; # https://github.com/NixOS/nixpkgs/pull/273060/files#diff-b78e5b1234a71c390023923ab5e62fc67b8e7d4371bc6687b7c7de4f392d1facR56 postFixup = '' buildPythonPath "$pythonPath" patchPythonScript $out/share/dia/python/scascale.py ''; }); }) ];}) home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; } nur.modules.nixos.default #chaotic.nixosModules.default ./hosts/sofue/configuration.nix ]; }; nixosConfigurations.palm = let system = "x86_64-linux"; source-pkgs = nixpkgs.legacyPackages.${system}; nixpkgs-patched = source-pkgs.applyPatches { name = "nixpkgs-patched"; src = nixpkgs; patches = []; }; nixosSystem = import (nixpkgs-patched + "/nixos/lib/eval-config.nix"); in nixosSystem { system = system; modules = [ self.settingsModule ({ lib, ... }: { nixpkgs.overlays = [ nur.overlays.default (self: super: { asNeeded = (pkg: commands: (lib.lists.forEach commands (command: super.writeShellScriptBin "${command}" '' install-as-needed "${pkg}" ${command} ''$@ '')) ); }) (self: super: { local-fonts = super.stdenv.mkDerivation local-fonts; }) (self: super: { camu = camu.packages.${system}.default; camu-devshell = camu.packages.${system}.shellWrapper; }) (self: super: { mauri = mauri.packages.${system}.default; }) #(self: super: { # sway-unwrapped = super.sway-unwrapped.overrideAttrs (oldAttrs: { # patches = oldAttrs.patches ++ []; # }); #}) (self: super: { adw-gtk3 = super.adw-gtk3.overrideAttrs (oldAttrs: { patches = [ ../files/patches/adw-gtk3-non-blue-accent.diff ]; }); }) (self: super: { vimPlugins = super.vimPlugins.extend (final: prev: { mini-nvim = prev.mini-nvim.overrideAttrs (oldAttrs: { patches = [ ./files/nvim/mini_starter_picture.diff ./files/nvim/mini_completion_no_title.diff ]; }); fzf-vim = prev.fzf-vim.overrideAttrs (oldAttrs: { patches = [ ./files/nvim/fzf_no_linenum.diff ]; }); }); }) ];}) home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; } nur.modules.nixos.default nixos-hardware.nixosModules.common-pc-laptop nixos-hardware.nixosModules.common-pc-laptop-ssd nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-gpu-nvidia-disable nixos-hardware.nixosModules.common-gpu-intel-kaby-lake ./hosts/palm/configuration.nix ]; }; nixosConfigurations.the-p = let system = "x86_64-linux"; source-pkgs = nixpkgs.legacyPackages.${system}; nixpkgs-patched = source-pkgs.applyPatches { name = "nixpkgs-patched"; src = nixpkgs; patches = [ ]; }; nixosSystem = import (nixpkgs-patched + "/nixos/lib/eval-config.nix"); in nixosSystem { system = system; modules = [ ({ ... }: { nixpkgs.overlays = [ #(self: super: { jdk21 = (optimizeWithFlags super.jdk21 "-O2 -march=znver1 -mtune=znver1 -fno-semantic-interposition -flto"); }) ]; }) ./hosts/moyo/container.nix ]; }; }; }