diff --git a/flake.lock b/flake.lock index 39c3742..f797d49 100644 --- a/flake.lock +++ b/flake.lock @@ -16,13 +16,31 @@ "type": "github" } }, + "catppuccin-vsc": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1704479967, + "narHash": "sha256-YcbqMvphGDiAXX+zvEPci4LmBr1zQhGlwT/or9g7gHs=", + "owner": "catppuccin", + "repo": "vscode", + "rev": "80122d60e2d3a169d0f640cfa347d91b78f814d5", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "vscode", + "type": "github" + } + }, "hardware": { "locked": { - "lastModified": 1704266875, - "narHash": "sha256-luA5SGmeIRZlgLfSLUuR3eacS63q2bJ0Yywqak5lj3E=", + "lastModified": 1704458188, + "narHash": "sha256-f6BYEuIqnbrs6J/9m1/1VdkJ6d63hO9kUC09kTPuOqE=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "8e34f33464d77bea2d5cf7dc1066647b1ad2b324", + "rev": "172385318068519900a7d71c1024242fa6af75f0", "type": "github" }, "original": { @@ -73,16 +91,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703992652, - "narHash": "sha256-C0o8AUyu8xYgJ36kOxJfXIroy9if/G6aJbNOpA5W0+M=", - "owner": "nixos", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "32f63574c85fbc80e4ba1fbb932cde9619bad25e", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-23.11", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -104,11 +122,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1704194953, + "narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6", "type": "github" }, "original": { @@ -118,12 +136,29 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1704295289, + "narHash": "sha256-9WZDRfpMqCYL6g/HNWVvXF0hxdaAgwgIGeLYiOhmes8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b0b2c5445c64191fd8d0b31f2b1a34e45a64547d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { + "catppuccin-vsc": "catppuccin-vsc", "hardware": "hardware", "home-manager": "home-manager", "nix-colors": "nix-colors", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable" } } diff --git a/flake.nix b/flake.nix index 8496dd3..c1519d7 100644 --- a/flake.nix +++ b/flake.nix @@ -2,23 +2,23 @@ description = "goop-drive config"; inputs = { - # Nixpkgs nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - # Home manager home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; hardware.url = "github:nixos/nixos-hardware"; - nix-colors.url = "github:misterio77/nix-colors"; + + catppuccin-vsc.url = "github:catppuccin/vscode"; }; outputs = { self, nixpkgs, home-manager, + catppuccin-vsc, ... } @ inputs: let inherit (self) outputs; diff --git a/home-manager/home.nix b/home-manager/home.nix index aa0cadd..9124d57 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,4 +1,4 @@ -{ inputs, outputs, pkgs, lib, ... }: +{ inputs, outputs, pkgs, lib, config, ... }: { imports = [ @@ -15,11 +15,17 @@ home.username = "oatmealine"; home.homeDirectory = "/home/oatmealine"; + nixpkgs.overlays = [ + outputs.overlays.additions + outputs.overlays.unstable-packages + inputs.catppuccin-vsc.overlays.default + ]; + nixpkgs.config.allowUnfree = true; # Packages that should be installed to the user profile. home.packages = with pkgs; let - discord = discord-canary.override { + discord = unstable.discord-canary.override { withOpenASAR = true; withVencord = true; }; @@ -29,7 +35,7 @@ # utils ripgrep jq # nix - nil nix-output-monitor + nix-output-monitor # dev sqlitebrowser sqlite-interactive # system @@ -38,6 +44,8 @@ strace ltrace lsof # apps vivaldi telegram-desktop onlyoffice-bin gnome.gnome-tweaks discord mpv + # compatilibility + wine # misc cowsay file which tree gnused grc # um @@ -98,8 +106,58 @@ programs.vscode = { enable = true; extensions = with pkgs.vscode-extensions; [ - bbenoist.nix + jnoortheen.nix-ide + sumneko.lua + ms-vsliveshare.vsliveshare + (catppuccin.catppuccin-vsc.override { + accent = "pink"; + boldKeywords = false; + italicComments = false; + italicKeywords = false; + extraBordersEnabled = false; + workbenchMode = "flat"; + #bracketMode = "rainbow"; + }) ]; + mutableExtensionsDir = false; + enableExtensionUpdateCheck = false; + enableUpdateCheck = false; + userSettings = with config.opinions.font; { + "telemetry.enableTelemetry" = false; + + "editor.tabSize" = 2; + "editor.cursorSmoothCaretAnimation" = "on"; + + "editor.fontFamily" = "'${monospace.family}', monospace"; + "editor.fontSize" = monospace.size; + + "terminal.integrated.fontFamily" = "\"${monospace.family}\""; + "terminal.integrated.fontSize" = monospace.size; + + "window.dialogStyle" = "custom"; + "window.titleBarStyle" = "custom"; + + "workbench.tips.enabled" = false; + "workbench.colorTheme" = "Catppuccin Mocha"; + + "nix.enableLanguageServer" = true; + "nix.serverPath" = "${lib.getExe pkgs.nil}"; + + "security.workspace.trust.untrustedFiles" = "open"; + + "explorer.confirmDelete" = false; + "explorer.confirmDragAndDrop" = false; + + "editor.bracketPairColorization.enabled" = false; + "editor.smoothScrolling" = true; + "editor.wordWrap" = "on"; + "editor.wrappingStrategy" = "advanced"; + "editor.fontWeight" = "normal"; + "editor.semanticHighlighting.enabled" = true; + + # prevent VSCode from modifying the terminal colors + "terminal.integrated.minimumContrastRatio" = 1; + }; }; shellColors.enable = true; @@ -140,6 +198,10 @@ binding = "Print"; command = "${lib.getExe pkgs.flameshot} gui"; }; + "take-screen-recording" = { + binding = "Print"; + command = "${lib.getExe pkgs.peek}"; + }; "grab-password" = let grabScript = pkgs.writeScript "grab-password" '' ${lib.getExe pkgs.rbw} get $(${lib.getExe pkgs.gnome.zenity} --entry --text="" --title="") | ${lib.getExe pkgs.xclip} -selection clipboard diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index b9f60e8..f86b276 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,4 +1,3 @@ { gnome = ./gnome.nix; - grub = ./grub.nix; } diff --git a/modules/nixos/grub.nix b/modules/nixos/grub.nix deleted file mode 100644 index dc933da..0000000 --- a/modules/nixos/grub.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ lib, config, pkga, ... }: - -with lib; -let - cfg = config.grubConfig; -in { - options.grubConfig = { - enable = mkEnableOption "GRUB customization"; - font = mkOption { - type = types.str; - }; - fontSize = mkOption { - type = types.number; - }; - }; - - config = mkIf cfg.enable { - boot.loader.grub.enable = true; - boot.loader.grub.font = cfg.font; - boot.loader.grub.fontSize = cfg.fontSize; - }; -} \ No newline at end of file diff --git a/nixos/configuration.nix b/nixos/configuration.nix index ce5c0b7..af0ca95 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -10,7 +10,6 @@ ./hardware-configuration.nix - outputs.nixosModules.grub outputs.nixosModules.gnome ./security.nix @@ -21,18 +20,26 @@ nixpkgs.config.allowUnfree = true; nixpkgs.config.allowAliases = false; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + substituters = + [ "https://nix-community.cachix.org" "https://devenv.cachix.org" ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" + ]; + }; + nixpkgs.overlays = [ + outputs.overlays.additions + outputs.overlays.unstable-packages + outputs.overlays.dynamic-triple-buffering + ]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - #grubConfig = { - # enable = true; - # font = "${pkgs.cozette}/share/fonts/truetype/CozetteVector.ttf"; - # fontSize = 10; - #}; - networking.hostName = "goop-drive"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -52,6 +59,10 @@ }; console.useXkbConfig = true; + # Prefer tlp over Gnome's power-profiles-daemon + #services.power-profiles-daemon.enable = false; + #services.tlp.enable = true; + # Enable CUPS to print documents. #services.printing.enable = false; diff --git a/nixos/lenovo-thinkpad-x1-1st-gen.nix b/nixos/lenovo-thinkpad-x1-1st-gen.nix index 5b730e2..4680de1 100644 --- a/nixos/lenovo-thinkpad-x1-1st-gen.nix +++ b/nixos/lenovo-thinkpad-x1-1st-gen.nix @@ -3,7 +3,12 @@ { config, ... }: { # Laptop-specific battery usage tuning + powerManagement.enable = true; + # Tune power saving options on boot #powerManagement.powertop.enable = true; + # Thermald proactively prevents overheating on Intel CPUs and works well with other tools. + services.thermald.enable = true; + boot.kernelParams = [ # Enable the i915 Sandybridge Framebuffer Compression (confirmed 475mw savings) "i915.i915_enable_fbc=1" diff --git a/nixos/security.nix b/nixos/security.nix index 093563a..067e3d3 100644 --- a/nixos/security.nix +++ b/nixos/security.nix @@ -1,5 +1,5 @@ { - #security.sudo.enable = false; + security.sudo.enable = false; security.doas.enable = true; security.doas.extraRules = [ { users = [ "oatmealine" ]; noPass = true; persist = false; keepEnv = true; } diff --git a/nixos/software.nix b/nixos/software.nix index 9041c48..a24eb44 100644 --- a/nixos/software.nix +++ b/nixos/software.nix @@ -51,4 +51,7 @@ atkinson-hyperlegible cozette ]; + + services.flatpak.enable = true; + programs.noisetorch.enable = true; } diff --git a/overlays/default.nix b/overlays/default.nix index 2911c13..17b0be8 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,17 +1,7 @@ -# This file defines overlays -{inputs, pkgs, ...}: { +{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: { @@ -24,7 +14,7 @@ dynamic-triple-buffering = (final: prev: { gnome = prev.gnome.overrideScope' (gnomeFinal: gnomePrev: { mutter = gnomePrev.mutter.overrideAttrs ( old: { - src = pkgs.fetchgit { + src = prev.fetchgit { url = "https://gitlab.gnome.org/vanvugt/mutter.git"; # GNOME 45: triple-buffering-v4-45 rev = "0b896518b2028d9c4d6ea44806d093fd33793689"; @@ -32,5 +22,5 @@ }; } ); }); - }) + }); }