Compare commits
No commits in common. "2ae8bf4fd0cfa559b1fb14e6c3ccfd50c9fefc23" and "41c3266ee2de353cc3030b241b715e2cc241f58c" have entirely different histories.
2ae8bf4fd0
...
41c3266ee2
|
@ -1,2 +1 @@
|
|||
{ ... } @ args:
|
||||
import ../dk/single_uefi_btrfs.nix (args // { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; })
|
||||
import ../dk/single_uefi_btrfs.nix { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ id, name, passwordFile ? "/should_not_be_needed_in_this_context", ... }:
|
||||
{ id, name, ... }:
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
|
@ -26,7 +26,7 @@
|
|||
content = {
|
||||
type = "luks";
|
||||
name = "${name}";
|
||||
passwordFile = passwordFile;
|
||||
passwordFile = "/tmp/secret.key"; # FIXME Generate this somehow
|
||||
settings = {
|
||||
# Not having SSDs die fast is more important than crypto
|
||||
# nerds that could potentially discover which filesystem I
|
||||
|
|
|
@ -1,35 +1,20 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
nixgl = import
|
||||
(builtins.fetchGit {
|
||||
url = "https://github.com/nix-community/nixGL";
|
||||
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
|
||||
})
|
||||
{ };
|
||||
nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ";
|
||||
wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./frobar
|
||||
];
|
||||
config = lib.mkIf config.frogeye.desktop.xorg {
|
||||
frogeye.shellAliases = {
|
||||
noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise'';
|
||||
beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null'';
|
||||
|
||||
# n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables
|
||||
x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout";
|
||||
# TODO Is it possible to not start nvidia stuff on nixOS?
|
||||
# nx = "nvidia-xrun ${config.xsession.scriptPath}; sudo systemctl start nvidia-xrun-pm; logout";
|
||||
x = "startx ${config.xdg.configHome}/xinitrc; logout";
|
||||
nx = "nvidia-xrun ${config.xdg.configHome}/xinitrc; sudo systemctl start nvidia-xrun-pm; logout";
|
||||
# Was also thinking of not storing the config in .config and use nix-store instead,
|
||||
# but maybe it's a bad idea as home-manager switch doesn't replace aliases in running shells
|
||||
# FIXME Is it still relevant with NixOS?
|
||||
};
|
||||
xsession = {
|
||||
enable = true;
|
||||
# Not using config.xdg.configHome because it needs to be $HOME-relative paths and path manipulation is hard
|
||||
scriptPath = ".config/xsession";
|
||||
profilePath = ".config/xprofile";
|
||||
windowManager = {
|
||||
command = lib.mkForce "${wmPrefix} ${config.xsession.windowManager.i3.package}/bin/i3";
|
||||
i3 = {
|
||||
enable = true;
|
||||
config =
|
||||
|
@ -83,6 +68,7 @@ in
|
|||
{
|
||||
modifier = "Mod4";
|
||||
terminal = "alacritty";
|
||||
bars = [ ]; # Using frobar
|
||||
colors = let ignore = "#ff00ff"; in
|
||||
with config.lib.stylix.colors.withHashtag; lib.mkForce {
|
||||
focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; };
|
||||
|
@ -324,6 +310,7 @@ in
|
|||
];
|
||||
};
|
||||
startup = [
|
||||
{ notification = false; command = "${pkgs.autorandr}/bin/autorandr --change"; }
|
||||
# Lock screen after 10 minutes
|
||||
{ notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; }
|
||||
{
|
||||
|
@ -511,9 +498,14 @@ in
|
|||
};
|
||||
autorandr = {
|
||||
enable = true;
|
||||
hooks.postswitch = {
|
||||
background = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}";
|
||||
};
|
||||
hooks.postswitch =
|
||||
let
|
||||
frobar = (pkgs.callPackage (import ./frobar) { });
|
||||
in
|
||||
{
|
||||
"background" = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}";
|
||||
"frobar" = "${pkgs.i3}/bin/i3-msg exec ${frobar}/bin/frobar_launcher";
|
||||
};
|
||||
};
|
||||
mpv = {
|
||||
enable = true;
|
||||
|
@ -561,6 +553,23 @@ in
|
|||
"pulse/client.conf" = {
|
||||
text = ''cookie-file = .config/pulse/pulse-cookie'';
|
||||
};
|
||||
"xinitrc" =
|
||||
let
|
||||
nixgl = import
|
||||
(builtins.fetchGit {
|
||||
url = "https://github.com/nix-community/nixGL";
|
||||
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
|
||||
})
|
||||
{ };
|
||||
nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ";
|
||||
wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}";
|
||||
in
|
||||
{
|
||||
source = pkgs.writeShellScript "xinitrc" ''
|
||||
${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path}
|
||||
${wmPrefix}${config.xsession.windowManager.command}
|
||||
'';
|
||||
};
|
||||
"rofimoji.rc" = {
|
||||
text = ''
|
||||
skin-tone = neutral
|
||||
|
@ -584,6 +593,7 @@ in
|
|||
};
|
||||
services = {
|
||||
unclutter.enable = true;
|
||||
# FIXME Not starting on curacao_test
|
||||
dunst =
|
||||
{
|
||||
enable = true;
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
|
||||
# documents
|
||||
visidata
|
||||
# texlive.combined.scheme-full
|
||||
# TODO Convert existing LaTeX documents into using Nix build system
|
||||
# texlive is big and not that much used, sooo
|
||||
texlive.combined.scheme-full
|
||||
pdftk
|
||||
hunspell
|
||||
hunspellDicts.en_GB-ize
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs ? import <nixpkgs> { config = { }; overlays = [ ]; }, ... }:
|
||||
{ pkgs ? import <nixpkgs> { config = { }; overlays = [ ]; } }:
|
||||
# Tried using pyproject.nix but mpd2 dependency wouldn't resolve,
|
||||
# is called pyton-mpd2 on PyPi but mpd2 in nixpkgs.
|
||||
let
|
||||
|
@ -6,7 +6,6 @@ let
|
|||
pname = "frobar";
|
||||
version = "2.0";
|
||||
|
||||
runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ];
|
||||
propagatedBuildInputs = with pkgs.python3Packages; [
|
||||
coloredlogs
|
||||
notmuch
|
||||
|
@ -16,33 +15,21 @@ let
|
|||
pulsectl
|
||||
pyinotify
|
||||
];
|
||||
makeWrapperArgs = [ "--prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [ lemonbar-xft wirelesstools ])}" ];
|
||||
|
||||
src = ./.;
|
||||
};
|
||||
frobar_launcher = pkgs.writeShellApplication
|
||||
{
|
||||
name = "frobar_launcher";
|
||||
runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ];
|
||||
text = ''
|
||||
pidfile=$XDG_RUNTIME_DIR/frobar/$DISPLAY.pid
|
||||
${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "$pidfile")"
|
||||
([ -f "$pidfile" ] && ${pkgs.procps}/bin/kill "$(<"$pidfile")") || true
|
||||
${frobar}/bin/frobar & disown
|
||||
echo $! > "$pidfile"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
config = {
|
||||
xsession.windowManager.i3.config.bars = [ ];
|
||||
programs.autorandr.hooks.postswitch = {
|
||||
frobar = "${pkgs.systemd}/bin/systemctl --user restart frobar";
|
||||
};
|
||||
systemd.user.services.frobar = {
|
||||
Unit = {
|
||||
Description = "frobar";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
# Wait for i3 to start. Can't use ExecStartPre because otherwise it blocks graphical-session.target, and there's nothing i3/systemd
|
||||
# TODO Do that better
|
||||
ExecStart = ''${pkgs.bash}/bin/bash -c "while ! ${pkgs.i3}/bin/i3-msg; do ${pkgs.coreutils}/bin/sleep 1; done; ${frobar}/bin/frobar"'';
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
};
|
||||
};
|
||||
}
|
||||
# TODO Connection with i3 is lost on start sometimes, more often than with Arch?
|
||||
# TODO Restore ability to build frobar with nix-build
|
||||
frobar_launcher
|
||||
# TODO Connection with i3 is lost sometimes, more often than with Arch?
|
||||
|
|
|
@ -64,7 +64,6 @@ fi
|
|||
|
||||
mountpoint="/mnt/nixos"
|
||||
nix_flakes_cmd="nix --extra-experimental-features nix-command --extra-experimental-features flakes"
|
||||
luks_pass_path="luks/$(basename ${profile})"
|
||||
|
||||
set -x
|
||||
|
||||
|
@ -74,15 +73,8 @@ sudo mkdir -p "$mountpoint"
|
|||
# Not great, but fixable with flakes I guess
|
||||
sudo ./add_channels.sh
|
||||
|
||||
# Load encryption password
|
||||
luks_pass_file="$(mktemp --suffix="luks_password")"
|
||||
pass $luks_pass_path | head -n1 | tr -d '\n' > $luks_pass_file
|
||||
|
||||
# Format or mount disk
|
||||
sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" --argstr passwordFile "$luks_pass_file" "$disko_config"
|
||||
|
||||
# Unload encryption password
|
||||
rm "$luks_pass_file"
|
||||
sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" "$disko_config"
|
||||
|
||||
# Generate hardware-config.nix
|
||||
sudo nixos-generate-config --no-filesystems --root "$mountpoint"
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
kexec-tools
|
||||
openvpn
|
||||
|
||||
# android tools
|
||||
android-udev-rules
|
||||
|
||||
# Needed for all the fetchFromGit in this repo on nixos-rebuild
|
||||
git
|
||||
];
|
||||
|
@ -34,7 +37,6 @@
|
|||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
programs = {
|
||||
adb.enable = true;
|
||||
# Enable compilation cache
|
||||
ccache.enable = true;
|
||||
# TODO Not enough, see https://nixos.wiki/wiki/CCache.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
users.users.geoffrey = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "adbusers" "wheel" ];
|
||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
shell = pkgs.zsh;
|
||||
|
||||
initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
{ ... } @ args:
|
||||
import ../dk/single_uefi_btrfs.nix (args // { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; })
|
||||
import ../dk/single_uefi_btrfs.nix { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; }
|
||||
|
|
Loading…
Reference in a new issue