alejandra reformatting

This commit is contained in:
Quentin Boyer 2022-05-01 10:32:31 +02:00
parent f508209435
commit def2ee0064
20 changed files with 540 additions and 466 deletions

View file

@ -1,9 +1,11 @@
{ config, lib, pkgs, ... }:
with lib;
with builtins;
{
config,
lib,
pkgs,
...
}:
with lib;
with builtins; {
options = {
extraInfo.email = mkOption {
type = types.nullOr types.str;

View file

@ -1,37 +1,40 @@
{
description = "NixOS configuration";
inputs =
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-mozilla = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
};
nix-alien.url = "github:thiagokokada/nix-alien";
nix-ld.url = "github:Mic92/nix-ld/main";
nvim-traxys = {
url = "github:traxys/nvim-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
zsh-traxys = {
url = "github:traxys/zsh-flake";
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-mozilla = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
};
nix-alien.url = "github:thiagokokada/nix-alien";
nix-ld.url = "github:Mic92/nix-ld/main";
nvim-traxys = {
url = "github:traxys/nvim-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
zsh-traxys = {
url = "github:traxys/zsh-flake";
};
};
outputs = { home-manager, nixpkgs, ... }@inputs: {
outputs = {
home-manager,
nixpkgs,
...
} @ inputs: {
nixosConfigurations = {
ZeNixLaptop = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
({ pkgs, ... }: {
({pkgs, ...}: {
nixpkgs.overlays = [
inputs.nvim-traxys.overlay."${system}"
inputs.nix-alien.overlay
inputs.nix-alien.overlay
(import inputs.nixpkgs-mozilla)
(final: prev: {
})
@ -42,7 +45,12 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.traxys = { config, lib, pkgs, ... }: {
home-manager.users.traxys = {
config,
lib,
pkgs,
...
}: {
imports = [
./home.nix
./graphical.nix

View file

@ -1,6 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}: {
programs.git = {
enable = true;
userName = "Quentin Boyer";

View file

@ -1,6 +1,8 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
home.packages = with pkgs; [
# Browser
firefox-wayland
@ -10,7 +12,7 @@
# IM
element-desktop
(discord.override { nss = pkgs.nss; })
(discord.override {nss = pkgs.nss;})
signal-desktop
# Mail

View file

@ -1,17 +1,15 @@
{ config
, pkgs
, lib
, ...
}:
let
rustVersion = (pkgs.rustChannelOf { channel = "stable"; }).rust;
{
config,
pkgs,
lib,
...
}: let
rustVersion = (pkgs.rustChannelOf {channel = "stable";}).rust;
rsPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
in
{
in {
home.packages = with pkgs; [
bitwarden-cli
nodePackages.vscode-json-languageserver
@ -33,8 +31,8 @@ in
linuxPackages.perf
unzip
tokei
gcc11
nix-alien
gcc11
nix-alien
];
services = {
@ -44,11 +42,11 @@ in
};
programs = {
direnv = {
enable = true;
nix-direnv.enable = true;
enableZshIntegration = true;
};
direnv = {
enable = true;
nix-direnv.enable = true;
enableZshIntegration = true;
};
home-manager = {
enable = true;
@ -74,9 +72,9 @@ in
};
programs.zsh = {
shellAliases = {
new-direnv = "nix flake new -t github:nix-community/nix-direnv";
};
shellAliases = {
new-direnv = "nix flake new -t github:nix-community/nix-direnv";
};
};
# This value determines the Home Manager release that your

View file

@ -1,43 +1,51 @@
{ stdenv, lib, fetchFromGitHub, kernel, kmod, name, ... }:
let anbox-modules =
fetchFromGitHub {
{
stdenv,
lib,
fetchFromGitHub,
kernel,
kmod,
name,
...
}: let
anbox-modules = fetchFromGitHub {
owner = "choff";
repo = "anbox-modules";
rev = "8148a162755bf5500a07cf41a65a02c8f3eb0af9";
sha256 = "sha256-5YeKwLP0qdtmWbL6AXluyTmVcmKJJOFcZJ5NxXSSgok=";
};
in
stdenv.mkDerivation rec {
inherit name;
version = "0";
stdenv.mkDerivation rec {
inherit name;
version = "0";
src = "${anbox-modules}/${name}";
src = "${anbox-modules}/${name}";
#sourceRoot = "${src}/${ashmem}";
hardeningDisable = [ "pic" "format" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
#sourceRoot = "${src}/${ashmem}";
hardeningDisable = ["pic" "format"];
nativeBuildInputs = kernel.moduleBuildDependencies;
KERNEL_SRC = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
KERNEL_SRC = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
buildPhase = "make INSTALL_MOD_PATH=$out";
installPhase = ''
modDir=$out/lib/modules/${kernel.modDirVersion}/kernel/updates/
mkdir -p $modDir
mv ${name}_linux.ko $modDir/.
'';
buildPhase = "make INSTALL_MOD_PATH=$out";
installPhase = ''
modDir=$out/lib/modules/${kernel.modDirVersion}/kernel/updates/
mkdir -p $modDir
mv ${name}_linux.ko $modDir/.
'';
/* makeFlags = [
"KERNELRELEASE=${kernel.modDirVersion}"
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=$(out)"
]; */
/*
makeFlags = [
"KERNELRELEASE=${kernel.modDirVersion}"
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=$(out)"
];
*/
meta = with lib; {
description = "Kernel module for anbox - ${name}";
homepage = "https://github.com/choff/anbox-modules";
license = licenses.gpl2;
maintainers = [ ];
platforms = platforms.linux;
};
}
meta = with lib; {
description = "Kernel module for anbox - ${name}";
homepage = "https://github.com/choff/anbox-modules";
license = licenses.gpl2;
maintainers = [];
platforms = platforms.linux;
};
}

View file

@ -1,18 +1,18 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
./pkg.nix
#./home.nix
./localcfg.nix
];
config,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./pkg.nix
#./home.nix
./localcfg.nix
];
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
@ -47,20 +47,22 @@
fonts.enableDefaultFonts = true;
fonts = {
fonts = with pkgs; [
(nerdfonts.override { fonts = [ "Hack" ]; })
(nerdfonts.override {fonts = ["Hack"];})
dejavu_fonts
];
fontconfig = {
defaultFonts = {
serif = [ "DejaVu" ];
sansSerif = [ "DejaVu Sans" ];
monospace = [ "Hack" ];
serif = ["DejaVu"];
sansSerif = ["DejaVu Sans"];
monospace = ["Hack"];
};
};
};
boot.kernelPackages = pkgs.linuxPackages;
/* nixpkgs.config.allowBroken = true; */
/*
nixpkgs.config.allowBroken = true;
*/
virtualisation.waydroid.enable = true;
security.pam.services.swaylock = {

View file

@ -1,31 +1,32 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "iomem=relaxed" ];
boot.initrd.availableKernelModules = ["ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.kernelParams = ["iomem=relaxed"];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/95baa216-c7f1-418d-be70-cd1d4102c837";
fsType = "btrfs";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/95baa216-c7f1-418d-be70-cd1d4102c837";
fsType = "btrfs";
};
fileSystems."/home" =
{
device = "/dev/disk/by-uuid/50e43b17-10c8-4bbe-893a-c709172867db";
fsType = "btrfs";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/50e43b17-10c8-4bbe-893a-c709172867db";
fsType = "btrfs";
};
swapDevices = [
];

View file

@ -1,9 +1,7 @@
{ ... }:
{
{...}: {
imports = [
<home-manager/nixos>
];
home-manager.useGlobalPkgs = true;
home-manager.users.traxys = (import /etc/nixos/traxys/home.nix);
home-manager.users.traxys = import /etc/nixos/traxys/home.nix;
}

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
boot = {
initrd = {
luks.devices = {
@ -32,24 +34,24 @@
};
};
/*
services.xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
layout = "us";
xkbVariant = "dvp";
libinput.enable = true;
desktopManager.session = [
{
name = "home-manager";
start = ''
${pkgs.runtimeShell} $HOME/.hm-xsession-dbg&
waitPID=$!
'';
}
];
};
*/
/*
services.xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
layout = "us";
xkbVariant = "dvp";
libinput.enable = true;
desktopManager.session = [
{
name = "home-manager";
start = ''
${pkgs.runtimeShell} $HOME/.hm-xsession-dbg&
waitPID=$!
'';
}
];
};
*/
users = {
users = {
@ -57,12 +59,12 @@
uid = 1000;
isNormalUser = true;
home = "/home/traxys";
extraGroups = [ "wheel" "networkmanager" "adbusers" ];
extraGroups = ["wheel" "networkmanager" "adbusers"];
shell = pkgs.zsh;
};
localtimed.group = "localtimed";
};
groups.localtimed = { };
groups.localtimed = {};
};
# Set your time zone.
@ -70,7 +72,7 @@
services.printing = {
enable = true;
drivers = [ pkgs.hplip pkgs.gutenprint pkgs.cnijfilter2 ];
drivers = [pkgs.hplip pkgs.gutenprint pkgs.cnijfilter2];
};
services.avahi = {
nssmdns = true;

View file

@ -1,10 +1,12 @@
{ config, pkgs, lib, ... }:
let
ashmem = config.boot.kernelPackages.callPackage ./anbox.nix { name = "ashmem"; };
binder = config.boot.kernelPackages.callPackage ./anbox.nix { name = "binder"; };
in
{
config,
pkgs,
lib,
...
}: let
ashmem = config.boot.kernelPackages.callPackage ./anbox.nix {name = "ashmem";};
binder = config.boot.kernelPackages.callPackage ./anbox.nix {name = "binder";};
in {
xdg = {
portal = {
enable = true;
@ -30,11 +32,13 @@ in
allowUnfree = true;
};
/* nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
nativeOnly = true;
};
}; */
/*
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
nativeOnly = true;
};
};
*/
programs.steam.enable = true;
}

View file

@ -1,6 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}: {
home.sessionVariables = {
RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache";
};

View file

@ -1,7 +1,10 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./terminal ./i3like.nix ];
config,
lib,
pkgs,
...
}: {
imports = [./terminal ./i3like.nix];
gtk = {
enable = true;
@ -26,12 +29,12 @@
normal = "000000";
bright = "545454";
};
red = { normal = "ff5555"; };
green = { normal = "55ff55"; };
yellow = { normal = "ffff55"; };
blue = { normal = "5555ff"; };
magenta = { normal = "ff55ff"; };
cyan = { normal = "55ffff"; };
red = {normal = "ff5555";};
green = {normal = "55ff55";};
yellow = {normal = "ffff55";};
blue = {normal = "5555ff";};
magenta = {normal = "ff55ff";};
cyan = {normal = "55ffff";};
white = {
normal = "bbbbbb";
bright = "ffffff";
@ -45,121 +48,125 @@
};
};
wm = let mod = config.wm.modifier; in
{
enable = true;
kind = "sway";
modifier = "Mod4";
wm = let
mod = config.wm.modifier;
in {
enable = true;
kind = "sway";
modifier = "Mod4";
font = {
name = "Hack Nerd Font";
style = "Regular";
size = 12.0;
};
bar = {
font = {
name = "Hack Nerd Font";
name = "Hack Nerd Font Mono";
style = "Regular";
size = 12.0;
};
bar = {
font = {
name = "Hack Nerd Font Mono";
style = "Regular";
size = 11.0;
};
};
wallpaper = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nix-wallpaper-simple-dark-gray.png";
printScreen = {
enable = true;
keybind = "Print";
};
menu = {
enable = true;
keybind = "${mod}+e";
};
exit = {
enable = true;
keybind = "${mod}+Shift+e";
};
notifications = {
enable = true;
font = "hack nerd font 10";
defaultTimeout = 7000;
};
startup = [
{ command = "signal-desktop"; }
{ command = "discord"; }
{ command = "firefox"; }
{ command = "element-desktop"; }
{ command = "thunderbird"; }
{ command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; }
{ command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; }
];
workspaces = {
moveModifier = "Shift";
definitions = {
"1:" = { key = "ampersand"; };
"2:" = { key = "bracketleft"; output = "DP-0"; };
"3:" = { key = "braceleft"; };
"4" = { key = "braceright"; };
"5" = { key = "parenleft"; };
"6" = { key = "equal"; };
"7" = { key = "asterisk"; };
"" = {
key = "parenright";
output = "HDMI-0";
assign = [ "Spotify" ];
};
"" = {
key = "w";
output = "HDMI-0";
assign = [
"Element"
"Signal"
"Discord"
];
};
"" = {
key = "m";
output = "HDMI-0";
assign = [ "Thunderbird" ];
};
};
};
keybindings = {
"${mod}+Shift+l" = "exec ${pkgs.swaylock-fancy}/bin/swaylock-fancy";
# Media Keys
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '+10%'";
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '-10%'";
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify play-pause";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify next";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify previous";
# Focus
"${mod}+Left" = "focus left";
"${mod}+Right" = "focus right";
"${mod}+Down" = "focus down";
"${mod}+Up" = "focus up";
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Right" = "move right";
"${mod}+Shift+Down" = "move down";
"${mod}+Shift+Up" = "move up";
# Layout
"${mod}+u" = "fullscreen toggle";
"${mod}+comma" = "layout tabbed";
# Misc
"${mod}+Shift+colon" = "kill";
"${mod}+Shift+J" = "reload";
"${mod}+Return" = "exec ${config.terminal.command}";
"${mod}+p" = "mode resize";
"${mod}+Shift+P" = "restart";
size = 11.0;
};
};
wallpaper = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nix-wallpaper-simple-dark-gray.png";
printScreen = {
enable = true;
keybind = "Print";
};
menu = {
enable = true;
keybind = "${mod}+e";
};
exit = {
enable = true;
keybind = "${mod}+Shift+e";
};
notifications = {
enable = true;
font = "hack nerd font 10";
defaultTimeout = 7000;
};
startup = [
{command = "signal-desktop";}
{command = "discord";}
{command = "firefox";}
{command = "element-desktop";}
{command = "thunderbird";}
{command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK";}
{command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK";}
];
workspaces = {
moveModifier = "Shift";
definitions = {
"1:" = {key = "ampersand";};
"2:" = {
key = "bracketleft";
output = "DP-0";
};
"3:" = {key = "braceleft";};
"4" = {key = "braceright";};
"5" = {key = "parenleft";};
"6" = {key = "equal";};
"7" = {key = "asterisk";};
"" = {
key = "parenright";
output = "HDMI-0";
assign = ["Spotify"];
};
"" = {
key = "w";
output = "HDMI-0";
assign = [
"Element"
"Signal"
"Discord"
];
};
"" = {
key = "m";
output = "HDMI-0";
assign = ["Thunderbird"];
};
};
};
keybindings = {
"${mod}+Shift+l" = "exec ${pkgs.swaylock-fancy}/bin/swaylock-fancy";
# Media Keys
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '+10%'";
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '-10%'";
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify play-pause";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify next";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify previous";
# Focus
"${mod}+Left" = "focus left";
"${mod}+Right" = "focus right";
"${mod}+Down" = "focus down";
"${mod}+Up" = "focus up";
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Right" = "move right";
"${mod}+Shift+Down" = "move down";
"${mod}+Shift+Up" = "move up";
# Layout
"${mod}+u" = "fullscreen toggle";
"${mod}+comma" = "layout tabbed";
# Misc
"${mod}+Shift+colon" = "kill";
"${mod}+Shift+J" = "reload";
"${mod}+Return" = "exec ${config.terminal.command}";
"${mod}+p" = "mode resize";
"${mod}+Shift+P" = "restart";
};
};
}

View file

@ -1,28 +1,38 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with builtins;
with lib;
let
with lib; let
cfg = config.wm;
common = import ./i3like-utils.nix { inherit config; };
common = import ./i3like-utils.nix {inherit config;};
startupNotifications =
if cfg.notifications.enable then [{
command = "${config.services.dunst.package}/bin/dunst";
notification = false;
always = true;
}] else [ ];
if cfg.notifications.enable
then [
{
command = "${config.services.dunst.package}/bin/dunst";
notification = false;
always = true;
}
]
else [];
wallpaperSet =
if cfg.wallpaper != null then [{
command = "${pkgs.feh}/bin/feh --bg-scale ${cfg.wallpaper}";
always = true;
notification = false;
}] else [ ];
if cfg.wallpaper != null
then [
{
command = "${pkgs.feh}/bin/feh --bg-scale ${cfg.wallpaper}";
always = true;
notification = false;
}
]
else [];
startup = startupNotifications ++ wallpaperSet ++ cfg.startup;
in
{
in {
config = mkIf (cfg.enable && cfg.kind == "i3") {
programs = {
i3status-rust = {
@ -99,14 +109,15 @@ in
assigns = common.assigns;
fonts = common.mkFont cfg.font;
modifier = cfg.modifier;
bars = [{
fonts = common.mkFont cfg.bar.font;
statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs ${config.home.homeDirectory}/.config/i3status-rust/config-bottom.toml";
}];
bars = [
{
fonts = common.mkFont cfg.bar.font;
statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs ${config.home.homeDirectory}/.config/i3status-rust/config-bottom.toml";
}
];
};
};
scriptPath = ".hm-xsession";
};
};
}

View file

@ -1,47 +1,48 @@
{ config }:
with builtins;
let
{config}:
with builtins; let
cfg = config.wm;
addKeyIf = cond: keybinds: newkey: if cond then newkey // keybinds else keybinds;
addKeyIf = cond: keybinds: newkey:
if cond
then newkey // keybinds
else keybinds;
keybindSolo = keys: submod: addKeyIf submod.enable keys {
"${submod.keybind}" = "exec ${submod.command}";
};
keydefs = [ cfg.printScreen cfg.menu cfg.exit ];
keybindSolo = keys: submod:
addKeyIf submod.enable keys {
"${submod.keybind}" = "exec ${submod.command}";
};
keydefs = [cfg.printScreen cfg.menu cfg.exit];
keybindingsKeydef = foldl' keybindSolo cfg.keybindings keydefs;
mod = cfg.modifier;
ws_def = cfg.workspaces.definitions;
get_ws = ws: getAttr ws ws_def;
workspaceFmt = name:
let key = (get_ws name).key; in
{
"${mod}+${key}" = "workspace ${name}";
"${mod}+${cfg.workspaces.moveModifier}+${key}" = "move container to workspace ${name}";
};
workspaceFmt = name: let
key = (get_ws name).key;
in {
"${mod}+${key}" = "workspace ${name}";
"${mod}+${cfg.workspaces.moveModifier}+${key}" = "move container to workspace ${name}";
};
workspaceAssign = name:
{
workspace = name;
output = (get_ws name).output;
};
workspaceAssign = name: {
workspace = name;
output = (get_ws name).output;
};
classAssign = name: {
"${name}" = map (app: { class = "${app}"; }) ((get_ws name).assign);
"${name}" = map (app: {class = "${app}";}) ((get_ws name).assign);
};
in
{
in {
mkFont = mod: {
names = [ mod.name ];
names = [mod.name];
style = mod.style;
size = mod.size;
};
keybindings = (foldl' (x: y: x // y) { } (map workspaceFmt (attrNames ws_def)))
keybindings =
(foldl' (x: y: x // y) {} (map workspaceFmt (attrNames ws_def)))
// keybindingsKeydef;
workspaceOutputAssign = map workspaceAssign (filter (ws: (get_ws ws).output != null) (attrNames ws_def));
assigns = foldl' (x: y: x // y) { } (map classAssign (attrNames ws_def));
assigns = foldl' (x: y: x // y) {} (map classAssign (attrNames ws_def));
}

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with builtins;
with lib;
{
imports = [ ./i3.nix ./sway.nix ];
config,
lib,
pkgs,
...
}:
with builtins;
with lib; {
imports = [./i3.nix ./sway.nix];
options = {
wm = {
@ -13,7 +16,7 @@ with lib;
description = "Manage window Manager";
};
kind = mkOption {
type = types.enum [ "i3" "sway" ];
type = types.enum ["i3" "sway"];
default = "sway";
description = "WM to use";
};
@ -156,12 +159,12 @@ with lib;
assign = mkOption {
type = types.listOf types.str;
description = "Assign class elements";
default = [ ];
default = [];
};
};
});
description = "Workspace descriptions";
default = { };
default = {};
};
moveModifier = mkOption {
type = types.str;

View file

@ -1,25 +1,36 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with builtins;
let
with builtins; let
cfg = config.wm;
common = import ./i3like-utils.nix { inherit config; };
common = import ./i3like-utils.nix {inherit config;};
startupNotifications =
if cfg.notifications.enable then [{
command = "${pkgs.mako}/bin/mako";
always = true;
}] else [ ];
if cfg.notifications.enable
then [
{
command = "${pkgs.mako}/bin/mako";
always = true;
}
]
else [];
startup = startupNotifications ++ cfg.startup;
in
{
in {
config = mkIf (cfg.enable && cfg.kind == "sway") {
home.packages = with pkgs; [
sway
] ++ (if cfg.wallpaper != null then [ pkgs.swaybg ] else [ ]);
home.packages = with pkgs;
[
sway
]
++ (
if cfg.wallpaper != null
then [pkgs.swaybg]
else []
);
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
@ -47,7 +58,7 @@ in
"sway/workspaces"
"sway/mode"
];
modules-center = [ "sway/window" ];
modules-center = ["sway/window"];
modules-right = [
"cpu"
"memory"
@ -60,9 +71,9 @@ in
modules = {
"sway/workspaces" = {
persistent_workspaces = {
"" = [ ];
"" = [ ];
"1:" = [ ];
"" = [];
"" = [];
"1:" = [];
};
numeric-first = true;
};
@ -89,7 +100,7 @@ in
};
"battery" = {
format = "{capacity}% {icon}";
format-icons = [ "" "" "" "" "" ];
format-icons = ["" "" "" "" ""];
};
"clock" = {
format-alt = "{:%a, %d. %b %H:%M}";
@ -104,39 +115,44 @@ in
wm.menu.command = mkDefault "${pkgs.wofi}/bin/wofi --show drun,run --allow-images";
wm.exit.command = mkDefault "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
wayland.windowManager.sway = {
enable = true;
extraConfig = mkIf (cfg.wallpaper != null) ''
output "*" bg ${cfg.wallpaper} fill
'';
output "*" bg ${cfg.wallpaper} fill
'';
config = {
inherit startup;
modifier = cfg.modifier;
bars = [{
command = "waybar";
}];
input =
let
inputs = config.extraInfo.inputs;
inputsCfg = [
(if inputs.keyboard != null then {
bars = [
{
command = "waybar";
}
];
input = let
inputs = config.extraInfo.inputs;
inputsCfg = [
(
if inputs.keyboard != null
then {
name = inputs.keyboard;
value =
{
xkb_layout = "us";
xkb_variant = "dvp";
xkb_options = "compose:102";
};
} else null)
(if inputs.touchpad != null then {
value = {
xkb_layout = "us";
xkb_variant = "dvp";
xkb_options = "compose:102";
};
}
else null
)
(
if inputs.touchpad != null
then {
name = inputs.touchpad;
value = { dwt = "disable"; };
} else null)
];
in
value = {dwt = "disable";};
}
else null
)
];
in
builtins.listToAttrs inputsCfg;
fonts = common.mkFont cfg.font;
window = {
@ -146,7 +162,6 @@ in
workspaceOutputAssign = common.workspaceOutputAssign;
assigns = common.assigns;
};
};
home.file = {

View file

@ -1,19 +1,23 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with builtins;
let
mkColor = mkOption { type = types.nullOr types.str; default = null; };
with builtins; let
mkColor = mkOption {
type = types.nullOr types.str;
default = null;
};
mkColorPair = {
normal = mkColor;
bright = mkColor;
};
cfg = config.terminal;
cCfg = cfg.colors;
in
{
imports = [ ./foot.nix ./kitty.nix ];
in {
imports = [./foot.nix ./kitty.nix];
options = {
terminal = {
@ -23,7 +27,7 @@ in
description = "Manage terminal";
};
kind = mkOption {
type = types.enum [ "foot" "kitty" ];
type = types.enum ["foot" "kitty"];
default = "foot";
description = "The terminal to be used";
};

View file

@ -1,55 +1,56 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with builtins;
let
with builtins; let
cfg = config.terminal;
cCfg = cfg.colors;
in
{
in {
config = mkIf (cfg.enable && cfg.kind == "foot") {
terminal.command = mkDefault "${pkgs.foot}/bin/foot";
terminal.command = mkDefault "${pkgs.foot}/bin/foot";
programs.foot = {
enable = true;
settings = {
colors =
let
colorCfg = value: mkIf (value != null) value;
colorCfgNormal = color: colorCfg color.normal;
colorCfgBright = color: if color.bright != null then color.bright else colorCfgNormal color;
in
{
background = colorCfg cCfg.background;
foreground = colorCfg cCfg.foreground;
colors = let
colorCfg = value: mkIf (value != null) value;
colorCfgNormal = color: colorCfg color.normal;
colorCfgBright = color:
if color.bright != null
then color.bright
else colorCfgNormal color;
in {
background = colorCfg cCfg.background;
foreground = colorCfg cCfg.foreground;
regular0 = colorCfgNormal cCfg.black;
bright0 = colorCfgBright cCfg.black;
regular0 = colorCfgNormal cCfg.black;
bright0 = colorCfgBright cCfg.black;
regular1 = colorCfgNormal cCfg.red;
bright1 = colorCfgBright cCfg.red;
regular1 = colorCfgNormal cCfg.red;
bright1 = colorCfgBright cCfg.red;
regular2 = colorCfgNormal cCfg.green;
bright2 = colorCfgBright cCfg.green;
regular2 = colorCfgNormal cCfg.green;
bright2 = colorCfgBright cCfg.green;
regular3 = colorCfgNormal cCfg.yellow;
bright3 = colorCfgBright cCfg.yellow;
regular3 = colorCfgNormal cCfg.yellow;
bright3 = colorCfgBright cCfg.yellow;
regular4 = colorCfgNormal cCfg.blue;
bright4 = colorCfgBright cCfg.blue;
regular4 = colorCfgNormal cCfg.blue;
bright4 = colorCfgBright cCfg.blue;
regular5 = colorCfgNormal cCfg.magenta;
bright5 = colorCfgBright cCfg.magenta;
regular5 = colorCfgNormal cCfg.magenta;
bright5 = colorCfgBright cCfg.magenta;
regular6 = colorCfgNormal cCfg.cyan;
bright6 = colorCfgBright cCfg.cyan;
regular6 = colorCfgNormal cCfg.cyan;
bright6 = colorCfgBright cCfg.cyan;
regular7 = colorCfgNormal cCfg.white;
bright7 = colorCfgBright cCfg.white;
regular7 = colorCfgNormal cCfg.white;
bright7 = colorCfgBright cCfg.white;
selection-foreground = colorCfg cCfg.selectionForeground;
};
selection-foreground = colorCfg cCfg.selectionForeground;
};
main = {
font = "${cfg.font.family}:size=${toString cfg.font.size}";
};

View file

@ -1,14 +1,14 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with builtins;
let
with builtins; let
cfg = config.terminal;
cCfg = cfg.colors;
in
{
in {
config = mkIf (cfg.enable && cfg.kind == "kitty") {
terminal.command = mkDefault "${pkgs.kitty}/bin/kitty";
programs.kitty = {
@ -17,42 +17,43 @@ in
name = cfg.font.family;
size = cfg.font.size;
};
settings =
let
colorCfg = value: mkIf (value != null) "#${value}";
colorCfgNormal = color: colorCfg color.normal;
colorCfgBright = color: if color.bright != null then "#${color.bright}" else colorCfgNormal color;
in
{
background = colorCfg cCfg.background;
foreground = colorCfg cCfg.foreground;
settings = let
colorCfg = value: mkIf (value != null) "#${value}";
colorCfgNormal = color: colorCfg color.normal;
colorCfgBright = color:
if color.bright != null
then "#${color.bright}"
else colorCfgNormal color;
in {
background = colorCfg cCfg.background;
foreground = colorCfg cCfg.foreground;
color0 = colorCfgNormal cCfg.black;
color8 = colorCfgBright cCfg.black;
color0 = colorCfgNormal cCfg.black;
color8 = colorCfgBright cCfg.black;
color1 = colorCfgNormal cCfg.red;
color9 = colorCfgBright cCfg.red;
color1 = colorCfgNormal cCfg.red;
color9 = colorCfgBright cCfg.red;
color2 = colorCfgNormal cCfg.green;
color10 = colorCfgBright cCfg.green;
color2 = colorCfgNormal cCfg.green;
color10 = colorCfgBright cCfg.green;
color3 = colorCfgNormal cCfg.yellow;
color11 = colorCfgBright cCfg.yellow;
color3 = colorCfgNormal cCfg.yellow;
color11 = colorCfgBright cCfg.yellow;
color4 = colorCfgNormal cCfg.blue;
color12 = colorCfgBright cCfg.blue;
color4 = colorCfgNormal cCfg.blue;
color12 = colorCfgBright cCfg.blue;
color5 = colorCfgNormal cCfg.magenta;
color13 = colorCfgBright cCfg.magenta;
color5 = colorCfgNormal cCfg.magenta;
color13 = colorCfgBright cCfg.magenta;
color6 = colorCfgNormal cCfg.cyan;
color14 = colorCfgBright cCfg.cyan;
color6 = colorCfgNormal cCfg.cyan;
color14 = colorCfgBright cCfg.cyan;
color7 = colorCfgNormal cCfg.white;
color15 = colorCfgBright cCfg.white;
color7 = colorCfgNormal cCfg.white;
color15 = colorCfgBright cCfg.white;
selection_foreground = colorCfg cCfg.selectionForeground;
};
selection_foreground = colorCfg cCfg.selectionForeground;
};
};
wayland.windowManager.sway.config.terminal = "${config.terminal.command}";
xsession.windowManager.i3.config.terminal = "${config.terminal.command}";