feat!(flake): update homix

Add more & generalize flake outputs:
    - templates: just a `default.nix` (TODO: add a `Haskell` template)
    - packages & devShells: create and use `forEachPkgs`
Add more `Wayland` things for `homix`:
    - `swww` - custom package + custom systemd service (TODO: abstract away)
    - `wired` - from flake + `home-manager` module
Add default `imports` and `nixokgs.overlays` for `reo101@homix`
    -- TODO: don't handwire it, somehow *auto-import* from `mkNixosHost` in `flake.nix`
This commit is contained in:
reo101 2023-02-12 01:32:13 +02:00
parent 406fe35116
commit 0879b52630
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
13 changed files with 499 additions and 35 deletions

View file

@ -0,0 +1,99 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{ inputs, outputs, lib, config, pkgs, ... }: {
# You can import other NixOS modules here
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# If you want to use overlays your own flake exports (from overlays dir):
# outputs.overlays.modifications
# outputs.overlays.additions
# Or overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
};
# FIXME: Add the rest of your current configuration
# TODO: Set your hostname
networking.hostName = "your-hostname";
# TODO: This is just an example, be sure to use whatever bootloader you prefer
boot.loader.systemd-boot.enable = true;
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users.users = {
# FIXME: Replace with your username
your-username = {
# TODO: You can set an initial password for your user.
# If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install.
# Be sure to change it (using passwd) after rebooting!
# initialPassword = "correcthorsebatterystaple";
isNormalUser = true;
openssh.authorizedKeys.keys = [
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
];
# TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc)
extraGroups = [ "wheel" ];
};
};
# This setups a SSH server. Very important if you're setting up a headless system.
# Feel free to remove if you don't need it.
services.openssh = {
enable = true;
# Forbid root login through SSH.
permitRootLogin = "no";
# Use keys only. Remove if you want to SSH using password (not recommended)
passwordAuthentication = false;
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "22.05";
}

View file

@ -0,0 +1,10 @@
# This is just an example, you should generate yours with nixos-generate-config and put it in here.
{
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};
# Set your system kind (needed for flakes)
nixpkgs.hostPlatform = "x86_64-linux";
}

View file

@ -0,0 +1,239 @@
(
shortcuts: (
notification_interact: 1,
notification_close: 2,
notification_closeall: 3,
),
poll_interval: 16,
max_notifications: 8,
history_length: 100,
replacing_enabled: true,
replacing_resets_timeout: true,
timeout: 5000, // 3 sec timeout
idle_threshold: 600, // 600 sec = 10 min
unpause_on_input: true,
// min_window_width: 0,
// min_window_height: 0,
debug: false,
debug_color: Color(r: 0.0, g: 1.0, b: 0.0, a: 1.0),
debug_color_alt: Color(r: 1.0, g: 0.0, b: 0.0, a: 1.0),
layout_blocks: [
(
name: "notif_root",
parent: "",
hook: (parent_anchor: TR, self_anchor: TR),
offset: (x: -10, y: 39),
params: NotificationBlock((
monitor: 0,
border_width: 2.0,
border_rounding: 0.0,
gap: (x: 0.0, y: 10.0),
background_color: (hex: "#0E1013"),
border_color: (hex: "#61AFEF"),
border_color_low: (hex: "#A0A8B7"),
border_color_critical: (hex: "#E55561"),
notification_hook: (parent_anchor: BL, self_anchor: TL),
)),
),
(
name: "notif_summary",
parent: "notif_root",
offset: (x: 0, y: 0),
hook: (parent_anchor: TL, self_anchor: TR),
params: TextBlock((
text: "%s",
padding: (left: 12.0, right: 12.0, top: 12.0, bottom: 7.0),
font: "JetBrainsMono Nerd Font 11",
color: (hex: "#A0A8B7"),
dimensions: (
width: (min: 300, max: 300),
height: (min: 0, max: 0),
),
dimensions_image_hint: (
width: (min: 233, max: 238),
height: (min: 0, max: 0)
),
dimensions_image_app: (
width: (min: 233, max: 238),
height: (min: 0, max: 0)
),
)),
),
(
name: "notif_body",
parent: "notif_summary",
offset: (x: 0, y: 0),
hook: (parent_anchor: BL, self_anchor: TL),
render_criteria: [ Body ],
render_anti_criteria: [ AppName("progress") ],
params: TextBlock((
text: "%b",
padding: (left: 12.0, right: 5.0, top: 5.0, bottom: 12.0),
font: "JetBrainsMono Nerd Font 10",
color: (hex: "#A0A8B7"),
dimensions: (
width: (min: 300, max: 300),
height: (min: 0, max: 100),
),
dimensions_image_hint: (
width: (min: 240, max: 240),
height: (min: 0, max: 100)
),
dimensions_image_app: (
width: (min: 240, max: 240),
height: (min: 0, max: 100)
),
)),
),
(
name: "notif_image",
parent: "notif_summary",
hook: (parent_anchor: TL, self_anchor: TR),
offset: (x: 0, y: 0),
render_criteria: [ AppImage, HintImage ],
params: ImageBlock((
image_type: HintThenApp,
padding: (left: 12.0, right: 5.0, top: 12.0, bottom: 10.0),
rounding: 5.0,
scale_width: 50,
scale_height: 50,
filter_mode: Lanczos3,
)),
),
(
name: "notif_progress",
parent: "notif_summary",
offset: (x: 0, y: 0),
hook: (parent_anchor: BL, self_anchor: TL),
render_criteria: [ Progress ],
render_anti_criteria: [ Body ],
params: ProgressBlock((
padding: (left: 12.0, right: 12.0, top: 8.5, bottom: 12.5),
border_width: 2.0,
border_rounding: 5.0,
fill_rounding: 5.0,
border_color: (hex: "#30363F"),
background_color: (hex: "#0E1013"),
fill_color: (hex: "#BF68D9"),
width: -1.0,
height: 14.0,
)),
),
(
name: "notif_buttonbox",
parent: "notif_body",
offset: (x: 12, y: 0),
hook: (parent_anchor: BL, self_anchor: TL),
render_criteria: [ ActionOther(0) ],
params: TextBlock((
text: "",
padding: (left: 0.0, right: 0.0, top: 0.0, bottom: 0.0),
font: "JetBrainsMono Nerd Font 11",
color: (hex: "#A0A8B7"),
dimensions: (
width: (min: 288, max: 288),
height: (min: 38, max: 38),
),
dimensions_image_hint: (
width: (min: 221, max: 221),
height: (min: 38, max: 38),
),
dimensions_image_app: (
width: (min: 221, max: 221),
height: (min: 38, max: 38),
),
)),
),
(
name: "notif_button1",
parent: "notif_buttonbox",
offset: (x: 0, y: 0),
hook: (parent_anchor: TL, self_anchor: TL),
render_criteria: [ ActionOther(0) ],
params: ButtonBlock((
text: "%a",
font: "JetBrainsMono Nerd Font 10",
action: OtherAction(0),
padding: (left: 8.0, right: 8.0, top: 4.0, bottom: 4.0),
border_width: 2.0,
border_rounding: 0.0,
fill_rounding: 0.0,
text_color: (hex: "#A0A8B7"),
text_color_hovered: (hex: "#FFFFFF"),
border_color: (hex: "#30363F"),
border_color_hovered: (hex: "#585b70"),
background_color: (hex: "#282C34"),
fill_color: (hex: "#FFFFFF"),
dimensions: (
width: (min: -1, max: -1),
height: (min: 0, max: 0)
),
)),
),
(
name: "notif_button2",
parent: "notif_button1",
offset: (x: 10, y: 0),
hook: (parent_anchor: TR, self_anchor: TL),
render_criteria: [ ActionOther(1) ],
params: ButtonBlock((
text: "%a",
font: "JetBrainsMono Nerd Font 10",
action: OtherAction(1),
padding: (left: 8.0, right: 8.0, top: 4.0, bottom: 4.0),
border_width: 2.0,
border_rounding: 0.0,
fill_rounding: 0.0,
text_color: (hex: "#A0A8B7"),
text_color_hovered: (hex: "#FFFFFF"),
border_color: (hex: "#30363F"),
border_color_hovered: (hex: "#585b70"),
background_color: (hex: "#282C34"),
fill_color: (hex: "#FFFFFF"),
dimensions: (
width: (min: -1, max: -1),
height: (min: 0, max: 0)
),
)),
),
(
name: "notif_button3",
parent: "notif_button2",
offset: (x: 10, y: 0),
hook: (parent_anchor: TR, self_anchor: TL),
render_criteria: [ ActionOther(2) ],
params: ButtonBlock((
text: "%a",
font: "JetBrainsMono Nerd Font 10",
action: OtherAction(2),
padding: (left: 8.0, right: 8.0, top: 4.0, bottom: 4.0),
border_width: 2.0,
border_rounding: 0.0,
fill_rounding: 0.0,
text_color: (hex: "#A0A8B7"),
text_color_hovered: (hex: "#FFFFFF"),
border_color: (hex: "#30363F"),
border_color_hovered: (hex: "#585b70"),
background_color: (hex: "#282C34"),
fill_color: (hex: "#FFFFFF"),
dimensions: (
width: (min: -1, max: -1),
height: (min: 0, max: 0)
),
)),
),
],
)

View file

@ -1,7 +1,19 @@
{ inputs, outputs, lib, config, pkgs, ... }:
{
imports = builtins.attrValues outputs.homeManagerModules;
imports = builtins.attrValues outputs.homeManagerModules ++ [
inputs.wired.homeManagerModules.default
];
nixpkgs = {
overlays = builtins.attrValues outputs.overlays ++ [
# inputs.neovim-nightly-overlay.overlay
inputs.zig-overlay.overlays.default
inputs.wired.overlays.default
];
config.allowUnfree = true;
};
home = {
username = "reo101";
@ -13,52 +25,50 @@
programs.home-manager.enable = true;
home.packages = with pkgs; [
# WM
river
## WM
river # window manager
swww # wallpaper deamon
# wired-notify # dunst on wayland
# Terminals
## Terminals
wezterm
foot
# Core
## Core
neovim
git
firefox
discord
vifm
# Shell
## Shell
zsh
starship
zoxide
ripgrep
# Dhall
## Dhall
dhall
dhall-lsp-server
# Nix
## Nix
rnix-lsp
nil
direnv
# Torrents
## Torrents
tremc
# Zig
## Rust
rustc
cargo
## Zig
# zigpkgs."0.10.1"
zigpkgs.master
# inputs.zls-overlay.packages.x86_64-linux.default
];
nixpkgs = {
overlays = [
# inputs.neovim-nightly-overlay.overlay
inputs.zig-overlay.overlays.default
];
config.allowUnfree = true;
};
# Enable the GPG Agent daemon.
services.gpg-agent = {
enable = true;
@ -70,16 +80,38 @@
enable = true;
userName = "reo101";
userEmail = "pavel.atanasov2001@gmail.com";
# signing = {
# signByDefault = true;
# key = "0x52F3E1D376F692C0";
# };
};
reo101.shell = {
enable = true;
};
systemd.user.services."swww" = {
Unit = {
Description = "Swww Daemon";
PartOf = "graphical-session.target";
};
Service = {
ExecStart = "${pkgs.swww}/bin/swww init";
ExecStop = "${pkgs.swww}/bin/swww kill";
Type = "simple";
Restart = "always";
RestartSec = 5;
};
Install = {
WantedBy = ["graphical-session.target"];
};
};
# services.swww = {
# enabled = true;
# };
services.wired = {
enable = true;
config = ../configs/wired.ron;
};
home.file = {
".config/nvim" = {
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/src/reovim";
@ -88,7 +120,7 @@
home.file.".config/river/init" = {
executable = true;
source = ./../river;
source = ../configs/river;
};
# home.file.".stack/config.yaml".text = lib.generators.toYAML {} {