From 97f95b7a96dfb256beefa5c14aaf02cadb0a5cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 9 Oct 2022 20:49:35 +0200 Subject: [PATCH] :rocket: add howdy --- flake.lock | 115 ++++++++++++++++++++++++++++++--- flake.nix | 4 ++ hosts/nixos-laptop/default.nix | 5 ++ modules/profiles/base.nix | 18 +++--- modules/profiles/desktop.nix | 2 + modules/security/default.nix | 13 ---- 6 files changed, 127 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index 99a2fec..6edd3ac 100644 --- a/flake.lock +++ b/flake.lock @@ -165,6 +165,21 @@ } }, "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -179,7 +194,7 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_4": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -231,6 +246,27 @@ "type": "github" } }, + "howdy": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", + "utils": "utils_3" + }, + "locked": { + "lastModified": 1665340940, + "narHash": "sha256-6IIBGkD4spWRvMTEXRxWa31IerfVc1SSTruggY/lNR4=", + "ref": "refs/heads/main", + "rev": "17159cf269ce194703bc04671bb6d2378d124959", + "revCount": 3, + "type": "git", + "url": "https://git.sr.ht/~moritzboehme/howdy" + }, + "original": { + "type": "git", + "url": "https://git.sr.ht/~moritzboehme/howdy" + } + }, "master": { "locked": { "lastModified": 1664278750, @@ -269,6 +305,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1665266435, + "narHash": "sha256-vLhkXxNzAIvJNLyjm6fGe9Rwy/lsE9dc5MgV7w1EtCs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8e8b0bd1fd99ac2bdca112f9e2431d7c80b1d655", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1664235386, "narHash": "sha256-hlkYFCJ9VKZPRW50vtpHHq4h1PJrptD5BbdLOEp4Lyc=", @@ -284,7 +336,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1645655918, "narHash": "sha256-ZfbEFRW7o237+A1P7eTKhXje435FCAoe0blj2n20Was=", @@ -300,8 +352,33 @@ }, "pre-commit-hooks": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "flake-utils": [ + "howdy", + "flake-utils" + ], + "nixpkgs": [ + "howdy", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1664708386, + "narHash": "sha256-aCD8UUGNYb5nYzRmtsq/0yP9gFOQQHr/Lsb5vW+mucw=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "2e4a708918e14fdbd534cc94aaa9470cd19b2464", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1663082609, @@ -328,11 +405,12 @@ "emacs-overlay": "emacs-overlay", "forgit-git": "forgit-git", "home-manager": "home-manager", + "howdy": "howdy", "master": "master", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", - "utils": "utils_3" + "utils": "utils_4" } }, "stable": { @@ -383,7 +461,28 @@ }, "utils_3": { "inputs": { - "flake-utils": "flake-utils_3" + "flake-utils": [ + "howdy", + "flake-utils" + ] + }, + "locked": { + "lastModified": 1657226504, + "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "type": "github" + } + }, + "utils_4": { + "inputs": { + "flake-utils": "flake-utils_4" }, "locked": { "lastModified": 1657226504, diff --git a/flake.nix b/flake.nix index e1a7416..0354470 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,8 @@ url = "github:SenchoPens/base16.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + howdy.url = "git+https://git.sr.ht/~moritzboehme/howdy"; }; outputs = @@ -84,6 +86,7 @@ self.overlays.default inputs.utils.overlay inputs.emacs-overlay.overlay + inputs.howdy.overlays.default ]; ############### @@ -108,6 +111,7 @@ } inputs.agenix.nixosModules.age inputs.base16.nixosModule + inputs.howdy.nixosModules.default ]; hosts.nixos-laptop.modules = [ diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 22ca98f..8bb6c1d 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -11,6 +11,11 @@ ./hardware-configuration.nix ]; + services.howdy = { + enable = true; + certainty = 3.0; + }; + # BOOT boot = { supportedFilesystems = [ "btrfs" ]; diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 8349bf8..17e35fc 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -25,7 +25,7 @@ with lib; shell = { abbreviations = { us = "systemctl --user"; - rs = "doas systemctl"; + rs = "sudo systemctl"; }; aliases = { ls = "exa -lh --icons --git"; @@ -34,8 +34,8 @@ with lib; rm = "rm -i"; mv = "mv -i"; - nix-switch = "doas nixos-rebuild switch --flake ~/.dotfiles"; - nix-boot = "doas nixos-rebuild boot --flake ~/.dotfiles"; + nix-switch = "sudo nixos-rebuild switch --flake ~/.dotfiles"; + nix-boot = "sudo nixos-rebuild boot --flake ~/.dotfiles"; nix-lock = "pushd ~/.dotfiles && nix flake update && popd"; latexwatch = ''find -type f -name "*.tex" | entr -c latexmk -pdf -silent''; @@ -110,6 +110,12 @@ with lib; (builtins.attrValues config.fileSystems)); }; + i18n.extraLocaleSettings = { + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + home-manager.users.moritz = { programs = { # Let Home Manager install and manage itself. @@ -120,12 +126,6 @@ with lib; home = { username = "moritz"; homeDirectory = "/home/moritz"; - language = { - base = "en_US.UTF-8"; - time = "de_DE.UTF-8"; - numeric = "de_DE.UTF-8"; - paper = "de_DE.UTF-8"; - }; stateVersion = "21.05"; }; xdg.userDirs.enable = true; diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 62fd2b8..962c48b 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -97,6 +97,8 @@ with lib; { }; }; + programs.xss-lock.enable = true; + environment.systemPackages = with pkgs; [ # nix nixpkgs-review diff --git a/modules/security/default.nix b/modules/security/default.nix index c877f90..3506583 100644 --- a/modules/security/default.nix +++ b/modules/security/default.nix @@ -68,19 +68,6 @@ # So we don't have to do this later... security.acme.acceptTerms = true; - # Enable doas as an alternative to sudo - security.doas = { - enable = lib.mkDefault true; - extraRules = [ - # Do not ask for a password again for some time after the user successfully authenticates. - { - groups = [ "wheel" "doas" ]; - persist = true; - } - ]; - }; - security.sudo.enable = !config.security.doas.enable; - # SSH services.openssh = { # Disable ssh password login