From 89f641be1a2b7eac883b15b98100ca70c6c87e7c Mon Sep 17 00:00:00 2001 From: Mx Kookie Date: Mon, 21 Dec 2020 06:23:30 +0100 Subject: code dump --- infra/libkookie/build | 10 ++++---- infra/libkookie/legacy/workstation/default.nix | 2 +- infra/libkookie/modules/workstation/default.nix | 1 + .../modules/workstation/emacs/bootstrap.nix | 5 ++++ infra/libkookie/modules/workstation/emacs/core.nix | 9 +++++++ .../modules/workstation/emacs/default.nix | 18 ++++++++++++++ .../modules/workstation/emacs/ekookie/default.el | 7 ++++++ .../modules/workstation/emacs/ekookie/loader.nix | 19 ++++++++++++++ .../libkookie/modules/workstation/emacs/setup.nix | 7 ++++++ .../modules/workstation/ui/i3/default.nix | 4 +-- infra/libkookie/roots/uwu.nix | 20 ++++++++++----- infra/website/content/blog/xxx_nuance.md | 7 ++++++ infra/website/content/blog/xxx_timetracking.md | 29 ++++++++++++++++++++++ 13 files changed, 123 insertions(+), 15 deletions(-) create mode 100644 infra/libkookie/modules/workstation/emacs/bootstrap.nix create mode 100644 infra/libkookie/modules/workstation/emacs/core.nix create mode 100644 infra/libkookie/modules/workstation/emacs/default.nix create mode 100644 infra/libkookie/modules/workstation/emacs/ekookie/default.el create mode 100644 infra/libkookie/modules/workstation/emacs/ekookie/loader.nix create mode 100644 infra/libkookie/modules/workstation/emacs/setup.nix create mode 100644 infra/website/content/blog/xxx_nuance.md create mode 100644 infra/website/content/blog/xxx_timetracking.md diff --git a/infra/libkookie/build b/infra/libkookie/build index db80a0232159..fb12b28beb78 100755 --- a/infra/libkookie/build +++ b/infra/libkookie/build @@ -24,22 +24,22 @@ function build { ## Build and output build path for debugging function debug { - build + build "$@" echo "Build path: $OUT" exit 0 } ## Build and switch to the new configuration (requires root) function switch { - build + build "$@" nix-env -p /nix/var/nix/profiles/system --set "$OUT" "$OUT"/bin/switch-to-configuration switch } case "$1" in - -s* | --switch*) shift; switch ;; - -d* | --debug*) shift; debug ;; - *) build ;; + -s* | --switch*) shift; switch "$@" ;; + -d* | --debug*) shift; debug "$@" ;; + *) build "$@" ;; esac rm -rf "$OUT"* diff --git a/infra/libkookie/legacy/workstation/default.nix b/infra/libkookie/legacy/workstation/default.nix index 5bc78f0efff9..ddc1f64a313d 100644 --- a/infra/libkookie/legacy/workstation/default.nix +++ b/infra/libkookie/legacy/workstation/default.nix @@ -18,7 +18,7 @@ ./chat ./creative ./devel - ./emacs + # ./emacs ./pass ./podman ./onepass diff --git a/infra/libkookie/modules/workstation/default.nix b/infra/libkookie/modules/workstation/default.nix index 099d81858f82..5775e053f742 100644 --- a/infra/libkookie/modules/workstation/default.nix +++ b/infra/libkookie/modules/workstation/default.nix @@ -1,5 +1,6 @@ { ... }: { imports = [ + ./emacs ./ui ]; } diff --git a/infra/libkookie/modules/workstation/emacs/bootstrap.nix b/infra/libkookie/modules/workstation/emacs/bootstrap.nix new file mode 100644 index 000000000000..4e540ece2658 --- /dev/null +++ b/infra/libkookie/modules/workstation/emacs/bootstrap.nix @@ -0,0 +1,5 @@ +{ home-manager, packge, ... }: + +{ + home.packages = [ package ]; +} diff --git a/infra/libkookie/modules/workstation/emacs/core.nix b/infra/libkookie/modules/workstation/emacs/core.nix new file mode 100644 index 000000000000..e955e5cdbcfb --- /dev/null +++ b/infra/libkookie/modules/workstation/emacs/core.nix @@ -0,0 +1,9 @@ +{ lib, config, pkgs, home-manager, ... } @ args: + + + +{ + home-manager.users = with lib; + (listToAttrs (map (user: nameValuePair "${user}" ({ ... }: + { imports = [ ./setup.nix ]; })) config.libkookie.activeUsers)); +} diff --git a/infra/libkookie/modules/workstation/emacs/default.nix b/infra/libkookie/modules/workstation/emacs/default.nix new file mode 100644 index 000000000000..57949cb333b7 --- /dev/null +++ b/infra/libkookie/modules/workstation/emacs/default.nix @@ -0,0 +1,18 @@ +/** + * A custom wrapper module to configure an emacs installation. + * + */ + +{ config, lib, pkgs, home-manager, options, ...} @ args: + +let cfg = config.libkookie.emacs; +in +with lib; +{ + options.libkookie.emacs = { + enable = mkEnableOption "emacs configuration module"; + }; + + config = (lib.trace args.options {}); # (import ./core.nix args); +} + diff --git a/infra/libkookie/modules/workstation/emacs/ekookie/default.el b/infra/libkookie/modules/workstation/emacs/ekookie/default.el new file mode 100644 index 000000000000..af12c0ff7373 --- /dev/null +++ b/infra/libkookie/modules/workstation/emacs/ekookie/default.el @@ -0,0 +1,7 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; Basic libkookie emacs configuration template ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + diff --git a/infra/libkookie/modules/workstation/emacs/ekookie/loader.nix b/infra/libkookie/modules/workstation/emacs/ekookie/loader.nix new file mode 100644 index 000000000000..3058341c20ee --- /dev/null +++ b/infra/libkookie/modules/workstation/emacs/ekookie/loader.nix @@ -0,0 +1,19 @@ +{ cfg, ... }: + +# let +# # Create an emacs module with a single file in it +# loadModule = (file: pkgs.runCommand "${file}" {} '' +# mkdir -p $out/share/emacs/site-lisp +# cp -v ${file} $out/share/emacs/site-lisp/ +# ''); + +# # Create a full config from a set of +# buildConfig = (anchor: modules: pkgs.symlinkJoin { +# name = "libkookie-emacs"; +# paths = modules ++ [ (loadModule "${anchor}") ]; +# }); +# in + +# (buildConfig "default.el" cfg.libkookie.features) + +{} diff --git a/infra/libkookie/modules/workstation/emacs/setup.nix b/infra/libkookie/modules/workstation/emacs/setup.nix new file mode 100644 index 000000000000..143fa6ba33a7 --- /dev/null +++ b/infra/libkookie/modules/workstation/emacs/setup.nix @@ -0,0 +1,7 @@ +{ myCfg }: + +{ config, lib, pkgs, ... } @ args: + +pkgs.emacsWithPackages (epkgs: + (with epkgs; [ + ])) diff --git a/infra/libkookie/modules/workstation/ui/i3/default.nix b/infra/libkookie/modules/workstation/ui/i3/default.nix index 1967558f1884..9c2c011231fd 100644 --- a/infra/libkookie/modules/workstation/ui/i3/default.nix +++ b/infra/libkookie/modules/workstation/ui/i3/default.nix @@ -9,9 +9,7 @@ { config, lib, pkgs, home-manager, ... } @ args: -let - cfg = config.libkookie.ui.i3; - libkookie = config.libkookie; +let cfg = config.libkookie.ui.i3; in with lib; { diff --git a/infra/libkookie/roots/uwu.nix b/infra/libkookie/roots/uwu.nix index e430b793f4c5..a292ba04a228 100644 --- a/infra/libkookie/roots/uwu.nix +++ b/infra/libkookie/roots/uwu.nix @@ -23,13 +23,22 @@ in imports = [ - ../config/nix - ../config/base - ../config/docker - ../config/workstation - ../config/workstation/hardware/trackpoint + # ../legacy/nix + # ../legacy/base + # ../legacy/docker + # ../legacy/workstation + # ../legacy/workstation/hardware/trackpoint ]; + libkookie = { + activeUsers = [ "spacekookie" ]; + userPath = ../configuration/users; + }; + + libkookie.emacs = { + enable = true; + }; + # libkookie.ui.i3.enable = true; home-manager.users = forActiveUsers { @@ -79,7 +88,6 @@ in nix.maxJobs = lib.mkDefault 4; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - services.mullvad.enable = true; programs.java.enable = true; # owo diff --git a/infra/website/content/blog/xxx_nuance.md b/infra/website/content/blog/xxx_nuance.md new file mode 100644 index 000000000000..6d24cca90920 --- /dev/null +++ b/infra/website/content/blog/xxx_nuance.md @@ -0,0 +1,7 @@ +Title: The relativity of nunace +Category: Blog +Tags: culture, politics +Date: 2020-12-20 +Status: Draft + + diff --git a/infra/website/content/blog/xxx_timetracking.md b/infra/website/content/blog/xxx_timetracking.md new file mode 100644 index 000000000000..1b5d7a605837 --- /dev/null +++ b/infra/website/content/blog/xxx_timetracking.md @@ -0,0 +1,29 @@ +Title: Bikeshedding time tracking tooling +Category: Blog +Date: 2020-12-16 +Tags: /dev/diary +Status: Draft + + +For the past year and a half or so I've been self employed as a +freelancer ([hire me] btw). Since then I've been confronted with the +question of time tracking. It's not something I generally did for my +personal projects, and while working for a consultancy, I usually had +access to some proprietary/enterprise tool running in the browser that +would allow me to track time done on different clients or projects. + +[hire me]: mailto:kookie@spacekookie.de + +I never quite liked the workflow of these tools however. For one, too +many things are in the browser for my taste, and secondly they often +made it difficult to see statistics, bulk edit entries, or deal with +entries with overlapping days (which is a problem when working late at +night, like I occasionally do). + +So I decided to write my own tool. Two drafts (one in Ruby, one in +Rust) later, enter: [cassiopeia], a plain text terminal time tracking +tool. + +[cassiopeia]: https://git.spacekookie.de + + -- cgit v1.2.3