diff --git a/flake.lock b/flake.lock index e8782bb4..d141d4d8 100644 --- a/flake.lock +++ b/flake.lock @@ -69,20 +69,20 @@ "home-manager": { "inputs": { "nixpkgs": [ - "nixpkgs-stable" + "nixpkgs-nixos-unstable" ] }, "locked": { - "lastModified": 1634544068, - "narHash": "sha256-RlRQBaAHfdWqfRyHdWuDPMkplBTYwuyDQqDcNbP/Sog=", + "lastModified": 1635839387, + "narHash": "sha256-2B6DqfTiwY5w2TljC4+AxEUuVYMTP5Fo2h5iGNIONvk=", "owner": "nix-community", "repo": "home-manager", - "rev": "ff2bed9dac84fb202bbb3c49fdcfe30c29d0b12f", + "rev": "288faaa5a65e72e37e6027024829b15c8bb69286", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-21.05", + "ref": "master", "repo": "home-manager", "type": "github" } @@ -139,11 +139,11 @@ }, "nixpkgs-nixos-unstable": { "locked": { - "lastModified": 1635403963, - "narHash": "sha256-0actzfzBAXvvDJ/EvPSGbtCPXUwSObQrcq0RpsPWZgA=", + "lastModified": 1635844945, + "narHash": "sha256-tZcL307dj28jgEU1Wdn+zwG9neyW0H2+ZjdVhvJxh9g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2deb07f3ac4eeb5de1c12c4ba2911a2eb1f6ed61", + "rev": "b67e752c29f18a0ca5534a07661366d6a2c2e649", "type": "github" }, "original": { @@ -155,11 +155,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1635456205, - "narHash": "sha256-CLZxFvwec8BhFlB5tkIq08UBDNNrijOY780UF6ubJXc=", + "lastModified": 1635933255, + "narHash": "sha256-cR4jRaog5/o5U0No0wNVgokfJma9vuiZhtcu3CUcb1M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "66d6ec6ed2ddc77d08cf677cc8230db39f051793", + "rev": "2fd5c69fa6057870687a6589a8c95da955188f91", "type": "github" }, "original": { @@ -203,11 +203,11 @@ }, "nur": { "locked": { - "lastModified": 1635525735, - "narHash": "sha256-XX7nE214023Hw6O79Gn8SIXzxCi8Z07TRUbFJQYiyM4=", + "lastModified": 1636008211, + "narHash": "sha256-kNy2aQ9uhJ9sXkQn+G90DsmSGgfk22lfSpqlm+CRBKw=", "owner": "nix-community", "repo": "NUR", - "rev": "e47eb508c9c3af5990bec7cc6d969502e58a1336", + "rev": "eed6ce5dd4e60583c5c673771caffa3d5425bfa7", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 8e4f51be..719a7eec 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,7 @@ ]; specialArgs = { inherit inputs; }; }; - foureighty = mkWorkstation nixpkgs-stable "x86_64-linux" "foureighty"; + foureighty = mkWorkstation nixpkgs-nixos-unstable "x86_64-linux" "foureighty"; skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv"; thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky"; bolty = mkServer nixpkgs-nixos-unstable "x86_64-linux" "bolty"; @@ -78,9 +78,9 @@ type = "github"; owner = "nix-community"; repo = "home-manager"; - ref = "release-21.05"; + ref = "master"; inputs = { - nixpkgs.follows = "nixpkgs-stable"; + nixpkgs.follows = "nixpkgs-nixos-unstable"; }; }; diff --git a/nixos/common-hardware.nix b/nixos/common-hardware.nix index 4c010efe..de1dc0f6 100644 --- a/nixos/common-hardware.nix +++ b/nixos/common-hardware.nix @@ -5,7 +5,33 @@ sound.enable = true; - networking.networkmanager.enable = true; + networking.networkmanager = { + enable = true; + dispatcherScripts = [ + { + source = pkgs.writeText "upHook" '' + enable_disable_wifi () + { + result=$(nmcli dev | grep "ethernet" | grep -w "connected") + if [ -n "$result" ]; then + nmcli radio wifi off + else + nmcli radio wifi on + fi + } + + if [ "$2" = "up" ]; then + enable_disable_wifi + fi + + if [ "$2" = "down" ]; then + enable_disable_wifi + fi + ''; + type = "basic"; + } + ]; + }; hardware.enableRedistributableFirmware = true; hardware.cpu.intel.updateMicrocode = true; diff --git a/nixos/gui/vscode.nix b/nixos/gui/vscode.nix index 5e77f445..bb91f898 100644 --- a/nixos/gui/vscode.nix +++ b/nixos/gui/vscode.nix @@ -3,7 +3,6 @@ home.packages = with pkgs; [ (vscode-with-extensions.override { vscodeExtensions = with vscode-extensions; [ - bbenoist.Nix ms-python.python ( vscode-utils.buildVscodeExtension { diff --git a/nixos/home-manager/programs.nix b/nixos/home-manager/programs.nix index 9030432e..467cca3c 100644 --- a/nixos/home-manager/programs.nix +++ b/nixos/home-manager/programs.nix @@ -22,7 +22,6 @@ go.enable = true; bat.enable = true; browserpass.enable = true; - obs-studio.enable = true; lsd.enable = true; lsd.enableAliases = true; }; diff --git a/nixos/i3/home.nix b/nixos/i3/home.nix index 09d9bf76..c444ca04 100644 --- a/nixos/i3/home.nix +++ b/nixos/i3/home.nix @@ -6,6 +6,7 @@ ./dunst.nix ./rofi.nix ./kdeconnect.nix + ./xidlehook.nix ]; home.sessionVariables = { diff --git a/nixos/i3/i3.nix b/nixos/i3/i3.nix index 41670f82..b3bd6674 100644 --- a/nixos/i3/i3.nix +++ b/nixos/i3/i3.nix @@ -14,7 +14,6 @@ in startup = [ { command = "exec hsetroot -solid '#002b36'"; always = true; notification = false; } { command = "exec setxkbmap -layout pl"; always = true; notification = false; } - { command = "exec $HOME/dev/dotfiles/nixos/i3/lock.sh"; always = false; notification = false; } { command = "exec $HOME/dev/dotfiles/nixos/i3/battery-popup.sh"; always = false; notification = false; } { command = "exec xdg-mime default org.gnome.Evince.desktop application/pdf"; always = false; notification = false; } { command = "exec ${pkgs.autorandr}/bin/autorandr -c"; always = false; notification = false; } diff --git a/nixos/i3/lock.sh b/nixos/i3/lock.sh deleted file mode 100755 index e35ad725..00000000 --- a/nixos/i3/lock.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')" - -xset s off -xset -dpms - -xidlehook \ - --not-when-fullscreen \ - --not-when-audio \ - --timer 60 \ - 'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' \ - 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \ - --timer 600 \ - 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1; systemctl suspend' \ - '' diff --git a/nixos/i3/rofi.nix b/nixos/i3/rofi.nix index 329a7aef..88802839 100644 --- a/nixos/i3/rofi.nix +++ b/nixos/i3/rofi.nix @@ -4,8 +4,6 @@ programs.rofi = { enable = true; font = "Fira Code Nerd Font 16"; - separator = "solid"; - scrollbar = false; theme = "solarized"; }; } diff --git a/nixos/i3/xidlehook.nix b/nixos/i3/xidlehook.nix new file mode 100644 index 00000000..c6214f86 --- /dev/null +++ b/nixos/i3/xidlehook.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: +{ + services.xidlehook = { + enable = true; + not-when-audio = true; + not-when-fullscreen = true; + environment = { + "PRIMARY_DISPLAY" = "$(xrandr | awk '/ primary/{print $1}')"; + }; + timers = [ + { + delay = 60; + command = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness .1"; + canceller = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness 1"; + } + { + delay = 600; + command = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness 1; systemctl suspend"; + } + ]; + + }; +}