From 26b211b64309ebd40319d39b6b12f210d9279091 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Tue, 16 Aug 2022 11:31:45 +0300 Subject: [PATCH] stylix and stuff --- configuration.nix | 11 +-- dotfiles/kmonad/keymap.kbd | 4 +- .../lua/my/plugins/vim-tmux-navigator.lua | 10 +-- flake.lock | 86 ++++++++++++++++++- flake.nix | 9 +- modules/applications/xmonad/Main.hs | 4 +- modules/default.nix | 1 + modules/nix.nix | 52 +++++------ modules/themes/default.nix | 25 +++++- 9 files changed, 148 insertions(+), 54 deletions(-) diff --git a/configuration.nix b/configuration.nix index 1c89cbc..6fd44a1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -48,7 +48,7 @@ in chainloader /EFI/Microsoft/Boot/bootmgfw.efi } ''; - theme = theme.grub.path; + # theme = theme.grub.path; version = 2; }; @@ -60,19 +60,10 @@ in # Enable sound. sound.enable = true; - home-manager.users.adrielus = { - manual.manpages.enable = false; - }; - - system.stateVersion = "19.03"; # TODO: put nixpkgs stuff inside their own file nixpkgs.config.allowUnfree = true; nixpkgs.config.allowBroken = true; - - nixpkgs.config.permittedInsecurePackages = [ - "electron-13.6.9" - ]; } diff --git a/dotfiles/kmonad/keymap.kbd b/dotfiles/kmonad/keymap.kbd index 77a1d18..e969454 100644 --- a/dotfiles/kmonad/keymap.kbd +++ b/dotfiles/kmonad/keymap.kbd @@ -1,8 +1,8 @@ (defcfg ;; For Linux ;; input (device-file "$DEVICE") ;; gets dynamically replaced by nix - input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:5:1.0-event-kbd") - ;; input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd") + ;; input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:5:1.0-event-kbd") + input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd") output (uinput-sink "My KMonad output" ;; To understand the importance of the following line, see the section on ;; Compose-key sequences at the near-bottom of this file. diff --git a/dotfiles/neovim/lua/my/plugins/vim-tmux-navigator.lua b/dotfiles/neovim/lua/my/plugins/vim-tmux-navigator.lua index e3cdd02..ab8b77b 100644 --- a/dotfiles/neovim/lua/my/plugins/vim-tmux-navigator.lua +++ b/dotfiles/neovim/lua/my/plugins/vim-tmux-navigator.lua @@ -4,12 +4,12 @@ local M = {} -- For some reason the default mappings do not work for me function M.setup() - vim.g.tmux_navigator_no_mappings = 1 + vim.g.tmux_navigator_no_mappings = 1 - map("n", "", ":TmuxNavigateLeft") - map("n", "", ":TmuxNavigateDown") - map("n", "", ":TmuxNavigateUp") - map("n", "", ":TmuxNavigateRight") + map("n", "", ":TmuxNavigateLeft") + map("n", "", ":TmuxNavigateDown") + map("n", "", ":TmuxNavigateUp") + map("n", "", ":TmuxNavigateRight") end return M diff --git a/flake.lock b/flake.lock index 70c04f9..7e444ab 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,27 @@ "type": "github" } }, + "base16": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1658847131, + "narHash": "sha256-X6Mml7cT0YR3WCD5fkUhpRVV5ZPcwdcDsND8r8xMqTE=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "6b404cda2e04ca3cf5ca7b877af9c469e1386acb", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, "collie": { "flake": false, "locked": { @@ -48,6 +69,28 @@ "type": "github" } }, + "coricamu": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1659649195, + "narHash": "sha256-wRpMO4Mm4uizR5M71iipdi8ssSYMEPPAIwWyFYnhnco=", + "owner": "danth", + "repo": "coricamu", + "rev": "cdd2f7326efd91509caf84e69b669a7f9e6782bc", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "coricamu", + "type": "github" + } + }, "dom": { "flake": false, "locked": { @@ -658,7 +701,8 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nixos-unstable": "nixos-unstable", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "nixpkgs-unstable": "nixpkgs-unstable", + "stylix": "stylix" } }, "snocvect": { @@ -693,6 +737,31 @@ "type": "github" } }, + "stylix": { + "inputs": { + "base16": "base16", + "coricamu": "coricamu", + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660382154, + "narHash": "sha256-OMh2cBIm8C/rVVgSuD9Tz0+04N98u1FsGNJMuYCIMDc=", + "owner": "danth", + "repo": "stylix", + "rev": "9185529e3dbededab5f13e5305667a705ee85528", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, "tailrec": { "flake": false, "locked": { @@ -709,6 +778,21 @@ "type": "github" } }, + "utils": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "xml": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 42e4461..86416a1 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + stylix = { + url = "github:danth/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + # keyboard layout configuration kmonad = { url = "github:kmonad/kmonad?dir=nix"; @@ -29,7 +35,7 @@ }; }; - outputs = inputs@{ self, nixpkgs, ... }: + outputs = inputs@{ self, stylix, nixpkgs, ... }: let system = "x86_64-linux"; provideInputs = @@ -55,6 +61,7 @@ modules = [ inputs.home-manager.nixosModules.home-manager inputs.kmonad.nixosModule + stylix.nixosModules.stylix overlays ./hardware/laptop.nix ./configuration.nix diff --git a/modules/applications/xmonad/Main.hs b/modules/applications/xmonad/Main.hs index 63dd991..b3f207f 100644 --- a/modules/applications/xmonad/Main.hs +++ b/modules/applications/xmonad/Main.hs @@ -10,11 +10,11 @@ import XMonad.Config (defaultConfig) import XMonad.Config.Kde import XMonad.Hooks.EwmhDesktops (ewmh, fullscreenEventHook) import XMonad.Hooks.ManageDocks +import XMonad.Layout.NoBorders import XMonad.Layout.Spacing import XMonad.Layout.ThreeColumns import XMonad.Operations import XMonad.Util.EZConfig -import XMonad.Layout.NoBorders kdeOn :: Bool kdeOn = False @@ -33,7 +33,7 @@ main = handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook, terminal = myTerminal, workspaces = myWorkspaces, - borderWidth = 0 + borderWidth = 0 } `additionalKeysP` keymap where diff --git a/modules/default.nix b/modules/default.nix index 6c646c7..984fed5 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -13,4 +13,5 @@ ./printers.nix # ./bluetooth.nix ]; + } diff --git a/modules/nix.nix b/modules/nix.nix index 6ce9b15..e18b0e5 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,45 +1,35 @@ { pkgs, ... }: { - # Idk why tf I need to add this here - nixpkgs.config.permittedInsecurePackages = [ - "nodejs-12.22.12" - ]; - - home-manager.users.adrielus = { - nixpkgs.config.permittedInsecurePackages = [ - "nodejs-12.22.12" - ]; - }; - nix = { - # Emanble nix flakes - package = pkgs.nixFlakes; - - trustedUsers = [ "root" "adrielus" "@wheel" ]; - - autoOptimiseStore = true; - optimise.automatic = true; gc.automatic = true; + optimise.automatic = true; # Protect nix-shell from garbage collection # TODO: look into whether this is still needed when using nix flakes extraOptions = '' keep-outputs = true keep-derivations = true - experimental-features = nix-command flakes ''; - # Caching and whatnot - binaryCaches = [ - "https://nix-community.cachix.org" - "https://cm-idris2-pkgs.cachix.org" - "https://cache.nixos.org" - # "https://all-hies.cachix.org" # Do I even use all-hies anymore? - ]; + settings = { + trusted-users = [ "root" "adrielus" "@wheel" ]; - binaryCachePublicKeys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cm-idris2-pkgs.cachix.org-1:YB2oJSEsD5oMJjAESxolC2GQtE6B5I6jkWhte2gtXjk=" - # "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k=" - ]; + auto-optimise-store = true; + + # Caching and whatnot + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://cm-idris2-pkgs.cachix.org" + "https://danth.cachix.org" + # "https://all-hies.cachix.org" # Do I even use all-hies anymore? + ]; + + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cm-idris2-pkgs.cachix.org-1:YB2oJSEsD5oMJjAESxolC2GQtE6B5I6jkWhte2gtXjk=" + "danth.cachix.org-1:wpodfSL7suXRc/rJDZZUptMa1t4MJ795hemRN0q84vI=" + # "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k=" + ]; + }; }; } diff --git a/modules/themes/default.nix b/modules/themes/default.nix index d9e1351..498ecf6 100644 --- a/modules/themes/default.nix +++ b/modules/themes/default.nix @@ -1,8 +1,29 @@ -{ ... }: { +{ pkgs, ... }: +let + base16-schemes = + pkgs.fetchFromGitHub { + owner = "base16-project"; + repo = "base16-schemes"; + rev = "99529527e7cb3d777fb6e041c2aabbe6cdec4c4c"; + sha256 = "08avs0fykyjl1k3476vhm9rm0hvrpl2hfmc78r3h6yfnjnnl6q66"; + }; + +in +{ imports = [ - ./gtk.nix # Sets up gtk theming + # ./gtk.nix # Sets up gtk theming ./xresources.nix # Sets up xresources ./fonts.nix # Installs fonts and stuff (TODO: consider moving this into the individual themes which require these fonts?) ./wallpaper.nix # Sets the wallpaper required by the current theme ]; + + stylix = { + image = ./wallpapers/synthwave.jpg; + polarity = "dark"; + + autoEnable = false; + targets.grub.enable = true; + + base16Scheme = "${base16-schemes}/catppuccin.yaml"; + }; }