From 2c893256c79a5bc052b48e077fcb0dbf7f780167 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Mon, 5 Jul 2021 00:01:15 +0300 Subject: [PATCH] stuff --- flake.lock | 130 +++------------- flake.nix | 10 +- users/patriot/default.nix | 305 +++++++++++++++++++------------------- 3 files changed, 171 insertions(+), 274 deletions(-) diff --git a/flake.lock b/flake.lock index c7c7d4c..b719db5 100644 --- a/flake.lock +++ b/flake.lock @@ -31,11 +31,11 @@ "pre-commit-hooks-nix": "pre-commit-hooks-nix" }, "locked": { - "lastModified": 1624345263, - "narHash": "sha256-km/ig4jYNZ0Ru0sN9/3jzMpIeNPGBREx5sJKu55INec=", + "lastModified": 1624885917, + "narHash": "sha256-CaAEhMKzuTyN9krTLZ1jWW3C5HzvKRZY/doVOezZZx0=", "owner": "hercules-ci", "repo": "hercules-ci-agent", - "rev": "0e07d0e926ffd822ce882c2f2514613dce772cf3", + "rev": "5eba6597af97e358542c6f968f6ef680ffd2a401", "type": "github" }, "original": { @@ -100,21 +100,6 @@ "type": "github" } }, - "devshell_2": { - "locked": { - "lastModified": 1622711433, - "narHash": "sha256-rGjXz7FA7HImAT3TtoqwecByLO5yhVPSwPdaYPBFRQw=", - "owner": "numtide", - "repo": "devshell", - "rev": "1f4fb67b662b65fa7cfe696fc003fcc1e8f7cc36", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, "digga": { "inputs": { "deploy": "deploy", @@ -199,44 +184,6 @@ "type": "github" } }, - "flakeCompat": { - "flake": false, - "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "helix": { - "inputs": { - "flakeCompat": "flakeCompat", - "nixCargoIntegration": "nixCargoIntegration", - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1624871120, - "narHash": "sha256-Z12RGXJ11o74HtWm2ypjppfBGwMUUHGRqWSTX1QaAF4=", - "owner": "helix-editor", - "repo": "helix", - "rev": "51162ae6b2f57a38b5878670bf6524b24b5604e6", - "type": "github" - }, - "original": { - "owner": "helix-editor", - "repo": "helix", - "type": "github" - } - }, "home": { "inputs": { "nixpkgs": [ @@ -244,11 +191,11 @@ ] }, "locked": { - "lastModified": 1624863040, - "narHash": "sha256-BeV2TDf0nBB4IituD4JhT5ZWRlPrIvu3Z4P0q0XbQOQ=", + "lastModified": 1625384440, + "narHash": "sha256-WnDK+LZioER6eeC8Sm7GPvbiS6XPyUqn+qtc2lvjLHo=", "owner": "nix-community", "repo": "home-manager", - "rev": "dc4337d9fed5b437913e51722fa150b9eae7d91c", + "rev": "ac319fd3149b23a3ad8ee24cb2def6e67acf194c", "type": "github" }, "original": { @@ -259,10 +206,10 @@ }, "latest": { "locked": { - "lastModified": 1624626397, - "narHash": "sha256-+h0ulo5//RqStx6g6MDqD9MzgmBfeZ1VYxwEaSmw/Zs=", - "path": "/nix/store/nanws06l7r1avkvjjga5vlv01y2v4n8d-source", - "rev": "e1f8852faac7638e88d5e8a5b9ee2a7568685e3f", + "lastModified": 1625281901, + "narHash": "sha256-DkZDtTIPzhXATqIps2ifNFpnI+PTcfMYdcrx/oFm00Q=", + "path": "/nix/store/wsfwxm10shvi4yr0ll8p4v1dp7l7wqfl-source", + "rev": "09c38c29f2c719cd76ca17a596c2fdac9e186ceb", "type": "path" }, "original": { @@ -311,28 +258,6 @@ "type": "github" } }, - "nixCargoIntegration": { - "inputs": { - "devshell": "devshell_2", - "nixpkgs": [ - "nixpkgs" - ], - "rustOverlay": "rustOverlay" - }, - "locked": { - "lastModified": 1624244973, - "narHash": "sha256-h+b4CwPjyibgwMYAeBaT5qBnxI0fsmGf66k23FqEH5Y=", - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "rev": "00f5df6d8e7eeeac2764b7fa2c57e2e81f5d47cd", - "type": "github" - }, - "original": { - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "type": "github" - } - }, "nixEvalLsp": { "inputs": { "flake-utils": "flake-utils_2", @@ -371,11 +296,11 @@ }, "nixos": { "locked": { - "lastModified": 1624626397, - "narHash": "sha256-+h0ulo5//RqStx6g6MDqD9MzgmBfeZ1VYxwEaSmw/Zs=", + "lastModified": 1625281901, + "narHash": "sha256-DkZDtTIPzhXATqIps2ifNFpnI+PTcfMYdcrx/oFm00Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e1f8852faac7638e88d5e8a5b9ee2a7568685e3f", + "rev": "09c38c29f2c719cd76ca17a596c2fdac9e186ceb", "type": "github" }, "original": { @@ -386,11 +311,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1624713701, - "narHash": "sha256-miYoO9/M+ZYlNPknRF9VYh6bQEQCPPz6lM0Pb60jbPk=", + "lastModified": 1625333638, + "narHash": "sha256-M6J9RN60XJyv6nUfDFCwnz5aVjhe8+GJnV8Q9VpdQQQ=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "03c60a2db286bcd8ecfac9a8739c50626ca0fd8e", + "rev": "41775780a0b6b32b3d32dcc32bb9bc6df809062d", "type": "github" }, "original": { @@ -438,11 +363,11 @@ ] }, "locked": { - "lastModified": 1624611910, - "narHash": "sha256-sbf/mDcG2E0lhAYwDxoL53kWD72XRD5FLUi7Ft4LN/k=", + "lastModified": 1625046037, + "narHash": "sha256-I+qqRcSNFHa+xrF5LLl8vrU4R0Uouj052gl17gTNRaQ=", "owner": "colemickens", "repo": "nixpkgs-wayland", - "rev": "2b079c65ee4ee4dc557b5f2428f1644fc1c868e6", + "rev": "03f164c2a5344768c8186989c30045b7c8c7ebf7", "type": "github" }, "original": { @@ -516,7 +441,6 @@ "ci-agent": "ci-agent", "darwin": "darwin", "digga": "digga", - "helix": "helix", "home": "home", "latest": "latest", "naersk": "naersk_2", @@ -532,22 +456,6 @@ "pkgs": "pkgs" } }, - "rustOverlay": { - "flake": false, - "locked": { - "lastModified": 1624242197, - "narHash": "sha256-J0+j4DYFaE0O0marb4QN/S1bUhpGwAjQ4O04kIYKcb8=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "df5d330f34b64194d64dcbafb91e82e01a89a229", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "utils": { "locked": { "lastModified": 1610051610, diff --git a/flake.nix b/flake.nix index ddd9204..344150a 100644 --- a/flake.nix +++ b/flake.nix @@ -27,17 +27,13 @@ url = "github:aaronjanse/nix-eval-lsp"; inputs.nixpkgs.follows = "nixos"; }; - helix = { - url = "github:helix-editor/helix"; - inputs.nixpkgs.follows = "nixos"; - }; nixpkgsWayland = { url = "github:colemickens/nixpkgs-wayland"; inputs.nixpkgs.follows = "nixos"; }; }; - outputs = inputs@{ self, pkgs, digga, nixos, ci-agent, home, nixos-hardware, nur, nixosPersistence, nixpkgsWayland, nixEvalLsp, helix, ... }: + outputs = inputs@{ self, pkgs, digga, nixos, ci-agent, home, nixos-hardware, nur, nixosPersistence, nixpkgsWayland, nixEvalLsp, ... }: digga.lib.mkFlake { inherit self inputs; @@ -45,9 +41,6 @@ channelsConfig = { allowUnfree = true; - permittedInsecurePackages = [ - "swftools-0.9.2" - ]; }; channels = { @@ -60,7 +53,6 @@ nixpkgsWayland.overlay (final: prev: { inherit (nixEvalLsp.packages.${prev.system}) nix-eval-lsp; - inherit (helix.packages.${prev.system}) helix; }) ]; }; diff --git a/users/patriot/default.nix b/users/patriot/default.nix index af1d299..c7ec363 100644 --- a/users/patriot/default.nix +++ b/users/patriot/default.nix @@ -360,10 +360,8 @@ in font-awesome (nerdfonts.override { fonts = [ "Iosevka" ]; }) # Programs - discord-canary-system - # lightcord - # discord-canary - element-desktop + # discord-canary-system + # element-desktop audacity krita gimp @@ -666,155 +664,6 @@ in separator = "none"; terminal = pkgBin "alacritty"; }; - waybar = - let - swayEnabled = config.wayland.windowManager.sway.enable; - in - { - enable = swayEnabled || config.wayland.windowManager.hikari.enable; - settings = [{ - layer = "top"; - position = "top"; - modules-left = if swayEnabled then [ "sway/workspaces" ] else [ ]; - modules-center = if swayEnabled then [ "sway/window" ] else [ ]; - modules-right = - [ "pulseaudio" "cpu" "memory" "temperature" "clock" "tray" ]; - modules = { - "tray" = { spacing = 8; }; - "cpu" = { format = "/cpu {usage}/"; }; - "memory" = { format = "/mem {}/"; }; - "temperature" = { - hwmon-path = "/sys/class/hwmon/hwmon1/temp2_input"; - format = "/tmp {temperatureC}C/"; - }; - "pulseaudio" = { - format = "/vol {volume}/ {format_source}"; - format-bluetooth = "/volb {volume}/ {format_source}"; - format-bluetooth-muted = "/volb/ {format_source}"; - format-muted = "/vol/ {format_source}"; - format-source = "/mic {volume}/"; - format-source-muted = "/mic/"; - }; - }; - }]; - style = - let - makeBorder = color: "border-bottom: 3px solid #${color};"; - makeInfo = color: '' - color: #${color}; - ${makeBorder color} - ''; - - clockColor = colorScheme.bright.magenta; - cpuColor = colorScheme.bright.green; - memColor = colorScheme.bright.blue; - pulseColor = { - normal = colorScheme.bright.cyan; - muted = colorScheme.bright.gray; - }; - tmpColor = { - normal = colorScheme.bright.yellow; - critical = colorScheme.bright.red; - }; - in - '' - * { - border: none; - border-radius: 0; - /* `otf-font-awesome` is required to be installed for icons */ - font-family: ${font}; - font-size: ${toString fontSize}px; - min-height: 0; - } - - window#waybar { - background-color: #${bgColor}; - /* border-bottom: 0px solid rgba(100, 114, 125, 0.5); */ - color: #${fgColor}; - transition-property: background-color; - transition-duration: .5s; - } - - #workspaces button { - padding: 0 5px; - background-color: transparent; - color: #${fgColor}; - border-bottom: 3px solid transparent; - } - - /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ - #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - box-shadow: inherit; - border-bottom: 3px solid #ffffff; - } - - #workspaces button.focused { - border-bottom: 3px solid #${acColor}; - } - - #workspaces button.urgent { - background-color: #${acColor}; - color: #${bgColor}; - } - - #mode { - background-color: #64727D; - border-bottom: 3px solid #ffffff; - } - - #clock, - #battery, - #cpu, - #memory, - #temperature, - #backlight, - #network, - #pulseaudio, - #custom-media, - #tray, - #mode, - #idle_inhibitor, - #mpd { - padding: 0 10px; - margin: 0 4px; - background-color: transparent; - ${makeInfo fgColor} - } - - label:focus { - color: #000000; - } - - #clock { - ${makeInfo clockColor} - } - - #cpu { - ${makeInfo cpuColor} - } - - #memory { - ${makeInfo memColor} - } - - #pulseaudio { - ${makeInfo pulseColor.normal} - } - - #pulseaudio.muted { - ${makeInfo pulseColor.muted} - } - - #temperature { - ${makeInfo tmpColor.normal} - } - - #temperature.critical { - ${makeInfo tmpColor.critical} - } - ''; - }; vscode = { enable = true; package = pkgs.vscodium; @@ -824,7 +673,7 @@ in in (pkgs.vscode-utils.extensionsFromVscodeMarketplace [ # Rust - (mkExt "rust-analyzer" "0.2.646" "matklad" "sha256-GL+0R2KuycvHs/+yKVfK1H89sKA+H41DLUsJwy4ngyc=") + (mkExt "rust-analyzer" "0.2.654" "matklad" "sha256-WTwk71/A2RDEY0X+h5lwujL/OmYtf6FAQTJy6PB9ZzM=") (mkExt "even-better-toml" "0.12.3" "tamasfe" "sha256-nDmmzVuADieNX9bcS3YQiemg27S4O02Pjj+rthkBAZw=") (mkExt "crates" "0.5.9" "serayuzgur" "sha256-YHIbnl2R7lqwJHi8qUQImClx9MWm+5Pc12vYw7e/RlA=") # Nix @@ -881,5 +730,153 @@ in pinentryFlavor = "qt"; }; }; + + xdg = { + enable = true; + configFile = { + "waybar/config".text = + let swayEnabled = config.wayland.windowManager.sway.enable; in + builtins.toJSON { + layer = "top"; + position = "top"; + modules-left = if swayEnabled then [ "sway/workspaces" ] else [ ]; + modules-center = if swayEnabled then [ "sway/window" ] else [ ]; + modules-right = + [ "pulseaudio" "cpu" "memory" "temperature" "clock" "tray" ]; + tray = { spacing = 8; }; + cpu = { format = "/cpu {usage}/"; }; + memory = { format = "/mem {}/"; }; + temperature = { + hwmon-path = "/sys/class/hwmon/hwmon1/temp2_input"; + format = "/tmp {temperatureC}C/"; + }; + pulseaudio = { + format = "/vol {volume}/ {format_source}"; + format-bluetooth = "/volb {volume}/ {format_source}"; + format-bluetooth-muted = "/volb/ {format_source}"; + format-muted = "/vol/ {format_source}"; + format-source = "/mic {volume}/"; + format-source-muted = "/mic/"; + }; + }; + "waybar/style.css".text = + let + makeBorder = color: "border-bottom: 3px solid #${color};"; + makeInfo = color: '' + color: #${color}; + ${makeBorder color} + ''; + + clockColor = colorScheme.bright.magenta; + cpuColor = colorScheme.bright.green; + memColor = colorScheme.bright.blue; + pulseColor = { + normal = colorScheme.bright.cyan; + muted = colorScheme.bright.gray; + }; + tmpColor = { + normal = colorScheme.bright.yellow; + critical = colorScheme.bright.red; + }; + in + '' + * { + border: none; + border-radius: 0; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: ${font}; + font-size: ${toString fontSize}px; + min-height: 0; + } + + window#waybar { + background-color: #${bgColor}; + /* border-bottom: 0px solid rgba(100, 114, 125, 0.5); */ + color: #${fgColor}; + transition-property: background-color; + transition-duration: .5s; + } + + #workspaces button { + padding: 0 5px; + background-color: transparent; + color: #${fgColor}; + border-bottom: 3px solid transparent; + } + + /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ + #workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + box-shadow: inherit; + border-bottom: 3px solid #ffffff; + } + + #workspaces button.focused { + border-bottom: 3px solid #${acColor}; + } + + #workspaces button.urgent { + background-color: #${acColor}; + color: #${bgColor}; + } + + #mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; + } + + #clock, + #battery, + #cpu, + #memory, + #temperature, + #backlight, + #network, + #pulseaudio, + #custom-media, + #tray, + #mode, + #idle_inhibitor, + #mpd { + padding: 0 10px; + margin: 0 4px; + background-color: transparent; + ${makeInfo fgColor} + } + + label:focus { + color: #000000; + } + + #clock { + ${makeInfo clockColor} + } + + #cpu { + ${makeInfo cpuColor} + } + + #memory { + ${makeInfo memColor} + } + + #pulseaudio { + ${makeInfo pulseColor.normal} + } + + #pulseaudio.muted { + ${makeInfo pulseColor.muted} + } + + #temperature { + ${makeInfo tmpColor.normal} + } + + #temperature.critical { + ${makeInfo tmpColor.critical} + } + ''; + }; + }; }; }