Compare commits

..

27 Commits

Author SHA1 Message Date
3f2875faa9 final commit before moving to gentoo
Nix is great, but it was hard for me to configure every part of system explicitly on everyday machine.
From now, I'm going to leave NixOS, but I will keep using Nix for further software development.
Mabye come back in PI for high level IOT Dev?
2025-08-12 18:06:17 +09:00
e6328e254b added whatever tf changes 2025-05-11 18:34:04 +09:00
b7342e6e6a removed arguments from zed's bash 2025-03-08 19:12:04 +09:00
390392813b toppled home-manager 2025-03-08 19:10:37 +09:00
3cf8a263c7 Removed unnecessary configs 2025-03-08 19:06:35 +09:00
9e2b554152 Added some packages 2025-03-08 19:00:55 +09:00
6ce0c1da57 Merge pull request 'organized and updated config' (#1) from organize-config into main
Reviewed-on: kenryuS/nixos-dotfiles#1
2025-03-07 18:10:33 +09:00
6216fcd751 the great update 2025-03-07 17:04:41 +09:00
442f46f622 created user package directory 2024-12-22 23:02:34 +09:00
c05821755c updated lock file 2024-12-22 17:03:17 +09:00
87d132cb4f started modifing configuration structure 2024-12-22 16:56:40 +09:00
1030d3e37f update 2024-12-21 00:05:36 +09:00
a72167be09 update 10/19/2024 2024-10-19 00:04:55 +09:00
ddd508b148 update 10/10/2024 2024-10-10 21:53:43 +09:00
43b7f5dda5 updated config for input method 2024-09-27 01:03:10 +09:00
b7776cc283 fixed property 2024-09-27 00:50:59 +09:00
44f0e39204 update: 9/26/2024 2024-09-27 00:49:10 +09:00
f81f24a954 Update 9/18/2024 00:25 2024-09-18 00:24:37 +09:00
d714d14fcd migrated to podman 2024-08-31 21:11:44 +09:00
33e9b6e48f switched to unstable branch 2024-08-29 19:05:59 +09:00
28d3694708 flake.lock: Update
Flake lock file updates:

• Updated input 'home-manager':
    'github:nix-community/home-manager/e1391fb22e18a36f57e6999c7a9f966dc80ac073' (2024-07-03)
  → 'github:nix-community/home-manager/c2cd2a52e02f1dfa1c88f95abeb89298d46023be' (2024-08-23)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/36bae45077667aff5720e5b3f1a5458f51cf0776' (2024-08-27)
  → 'github:NixOS/nixpkgs/71e91c409d1e654808b2621f28a327acfdad8dc2' (2024-08-28)
2024-08-29 19:00:00 +09:00
02ded93d14 Update ~8/26/24 2024-08-29 18:54:36 +09:00
eebaa957af Update: 08/18/2024 06:51:28 PM 2024-08-18 18:52:15 +09:00
15832ba2f3 added some dev apps and services 2024-08-15 01:11:28 +09:00
70bb31c3f5 added plasma 2024-08-13 22:36:15 +09:00
0940cc8427 added flatpak 2024-08-13 21:50:31 +09:00
8c79af7feb added firefox and git config 2024-08-13 21:09:41 +09:00
105 changed files with 1290 additions and 648 deletions

View File

@@ -2,4 +2,6 @@
dotfiles for nixos dotfiles for nixos
referenced heavily on [librephoenix's nixos-config](https://github.com/librephoenix/nixos-config). ~~referenced heavily on [librephoenix's nixos-config](https://github.com/librephoenix/nixos-config).~~
This config is now more looks like [sioodmy's config](https://github.com/sioodmy/dotfiles).

53
flake.lock generated
View File

@@ -1,33 +1,30 @@
{ {
"nodes": { "nodes": {
"home-manager": { "homix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": "nixpkgs"
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1723399884, "lastModified": 1720719665,
"narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", "narHash": "sha256-BKcOoDlMC86zExMKXFXQ04HO99fUNFmtEdvP+gB45Pk=",
"owner": "nix-community", "owner": "sioodmy",
"repo": "home-manager", "repo": "homix",
"rev": "086f619dd991a4d355c07837448244029fc2d9ab", "rev": "62bc58f2350cbb061e61ac0f3d63018663fbe4cb",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "sioodmy",
"ref": "master", "repo": "homix",
"repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1723310128, "lastModified": 1752666637,
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=", "narHash": "sha256-P8J72psdc/rWliIvp8jUpoQ6qRDlVzgSDDlgkaXQ0Fw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf", "rev": "d1bfa8f6ccfb5c383e1eba609c1eb67ca24ed153",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -39,11 +36,27 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1723362943, "lastModified": 1719690277,
"narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", "narHash": "sha256-0xSej1g7eP2kaUF+JQp8jdyNmpmCJKRpO12mKl/36Kc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a58bc8ad779655e790115244571758e8de055e3d", "rev": "2741b4b489b55df32afac57bc4bfd220e8bf617e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1752687322,
"narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -54,9 +67,9 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "homix": "homix",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs_2"
} }
} }
}, },

View File

@@ -3,65 +3,23 @@
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/master"; homix.url = "github:sioodmy/homix";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
}; };
outputs = inputs@{ nixpkgs, home-manager, ... }: outputs = inputs@{ self, nixpkgs, homix, ... }:
let let
systemSettings = {
system = "x86_64-linux";
hostname = "kenryu-nixos";
machine = "workstation";
timezone = "Asia/Tokyo";
locale = "ja_JP.UTF-8";
bootConf = {
mode = "uefi";
mountPath = "/boot";
grubDev = "";
};
gpuType = "nvidia";
};
userSettings = {
username = "kenryus";
name = "Kenryu Shibata";
email-dev = "kenryudev5894@gmail.com";
dotfilesDir = "/etc/nixos";
editor = "nvim";
editor-pkg = pkgs.neovim;
};
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
system = systemSettings.system; system = "x86_64-linux";
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true );
};
}; };
lib = inputs.nixpkgs.lib; lib = inputs.nixpkgs.lib;
home-manager = inputs.home-manager; in
in { {
nixosConfigurations.system = lib.nixosSystem { nixosModules = {
system = systemSettings.system; homix = homix.nixosModules.default;
modules = [
(./. + "/machines" + ("/" + systemSettings.machine) + "/configuration.nix")
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${userSettings.username} = import (./. + "/machines" + ("/" + systemSettings.machine) + "/home.nix");
home-manager.extraSpecialArgs = {
inherit userSettings;
};
}
];
specialArgs = {
inherit systemSettings;
inherit userSettings;
inherit inputs;
};
}; };
nixosConfigurations = import ./hosts inputs;
}; };
} }

20
hosts/default.nix Normal file
View File

@@ -0,0 +1,20 @@
{ self, nixpkgs, ... }:
let
inherit (self) inputs;
mkHost = name:
nixpkgs.lib.nixosSystem {
modules = [
./${name}
../overlays
] ++ builtins.attrValues self.nixosModules;
specialArgs = {
inherit inputs;
systemSettings = import ./${name}/systemSettings.nix;
userSettings = import ../user/userSettings.nix;
};
};
in
{
syushiki = mkHost "syushiki";
}

View File

@@ -0,0 +1,52 @@
{ config, lib, pkgs, modulesPath, systemSettings, ... }: {
imports = [
../../system
../../system/nvidia
../../user
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f4c95da6-3c6b-4414-a62a-c8c26c4a1c73";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C83C-841F";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
fileSystems."/run/media/kenryus/hdd" = {
device = "/dev/disk/by-uuid/0d146628-12f4-4bb6-abde-bbf798a57c25";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/d933c349-8e70-41e1-8d13-605656dba18b"; }
];
nixpkgs.hostPlatform = lib.mkDefault systemSettings.system;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
programs.appimage = {
enable = true;
binfmt = true;
};
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 3000 3001 22 ];
system.stateVersion = "24.05"; # Did you read the changelog?
}

View File

@@ -0,0 +1,6 @@
{
system = "x86_64-linux";
hostname = "kenryu-nixos";
timezone = "Asia/Tokyo";
locale = "ja_JP.UTF-8";
}

View File

@@ -1,41 +0,0 @@
{ pkgs, lib, config, systemSettings, userSettings, ... }:
{
imports = [
../system/hardware/audio.nix
../system/hardware/time.nix
../system/services/network-manager.nix
../system/utils.nix
];
time.timeZone = systemSettings.timezone;
networking.hostName = systemSettings.hostname;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true;
i18n.defaultLocale = systemSettings.locale;
i18n.extraLocaleSettings = {
LC_ADDRESS = systemSettings.locale;
LC_IDENTIFICATION = systemSettings.locale;
LC_MEASUREMENT = systemSettings.locale;
LC_MONETARY = systemSettings.locale;
LC_NAME = systemSettings.locale;
LC_NUMERIC = systemSettings.locale;
LC_PAPER = systemSettings.locale;
LC_TELEPHONE = systemSettings.locale;
LC_TIME = systemSettings.locale;
};
users.users.${userSettings.username} = {
isNormalUser = true;
description = userSettings.name;
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [];
uid = 1000;
};
environment.shells = with pkgs; [ bash ];
users.defaultUserShell = pkgs.bash;
}

View File

@@ -1,31 +0,0 @@
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../base.nix
../../system/services/cups.nix
../../system/services/ssh.nix
../../system/services/polkit.nix
../../system/hardware/kernel.nix
../../system/hardware/nvidia.nix
../../system/hardware/opengl.nix
../../system/hardware/bluetooth.nix
../../system/wm/sddm.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
system.stateVersion = "24.05"; # Did you read the changelog?
}

View File

@@ -1,41 +0,0 @@
# 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")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f4c95da6-3c6b-4414-a62a-c8c26c4a1c73";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C83C-841F";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/d933c349-8e70-41e1-8d13-605656dba18b"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,16 +0,0 @@
{ pkgs, userSettings, ... }:
{
home.username = userSettings.username;
home.homeDirectory = "/home/" + userSettings.username;
programs.home-manager.enable = true;
imports = [
../../user/utils/alacritty.nix
../../user/wm/xmonad/xmonad.nix
];
home.stateVersion = "24.05";
home.packages = with pkgs; [];
}

11
overlays/default.nix Normal file
View File

@@ -0,0 +1,11 @@
{ config, pkgs, lib, ... }:
{
nixpkgs.overlays = [
(final: prev: {
qemu_full = prev.qemu_full.override {
cephSupport = false;
xenSupport = false;
};
})
];
}

23
system/audio/default.nix Normal file
View File

@@ -0,0 +1,23 @@
{ pkgs, ... }:
{
services.pulseaudio = {
support32Bit = true;
daemon.config = {
flat-volumes = "yes";
};
package = pkgs.pulseaudioFull;
};
security.rtkit.enable = true;
#services.pipewire = {
# enable = true;
# alsa.enable = true;
# alsa.support32Bit = true;
# pulse.enable = true;
# jack.enable = true;
#};
environment.systemPackages = with pkgs; [
alsa-utils
];
}

19
system/default.nix Normal file
View File

@@ -0,0 +1,19 @@
{ pkgs, ... }: {
imports = [
./audio
./bluetooth
./inputMethods
./kernel
./locale
./network
./nix
./opengl
./time
./users
./services
./vnc
./wm
./env.nix
./utils.nix
];
}

6
system/env.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }:
{
environment.variables = {
EDITOR = "vim";
};
}

View File

@@ -1,13 +0,0 @@
{ ... }:
{
#hardware.pulseaudio.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
}

View File

@@ -1,5 +0,0 @@
{ config, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_xanmod_stable;
boot.consoleLogLevel = 3;
}

View File

@@ -1,7 +0,0 @@
{ pkgs, ... }:
{
hardware.opengl.enable = true;
hardware.opengl.extraPackages = with pkgs; [
mesa
];
}

View File

@@ -1,4 +0,0 @@
{ ... }:
{
services.timesyncd.enable = true;
}

View File

@@ -0,0 +1,17 @@
{ config, lib, pkgs, systemSettings, ... }:
{
i18n = {
inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
plasma6Support = true;
addons = with pkgs; [
fcitx5-mozc
fcitx5-skk
];
};
};
};
}

View File

@@ -0,0 +1,5 @@
{ config, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages;
boot.consoleLogLevel = 3;
}

14
system/locale/default.nix Normal file
View File

@@ -0,0 +1,14 @@
{ systemSettings, ... }: {
i18n.defaultLocale = systemSettings.locale;
i18n.extraLocaleSettings = {
LC_ADDRESS = systemSettings.locale;
LC_IDENTIFICATION = systemSettings.locale;
LC_MEASUREMENT = systemSettings.locale;
LC_MONETARY = systemSettings.locale;
LC_NAME = systemSettings.locale;
LC_NUMERIC = systemSettings.locale;
LC_PAPER = systemSettings.locale;
LC_TELEPHONE = systemSettings.locale;
LC_TIME = systemSettings.locale;
};
}

View File

@@ -0,0 +1,9 @@
{ systemSettings, ... }:
{
networking = {
hostName = systemSettings.hostname;
networkmanager.enable = true;
firewall.enable = true;
};
systemd.services.NetworkManager-wait-online.enable = false;
}

34
system/nix/default.nix Normal file
View File

@@ -0,0 +1,34 @@
{ ... }: {
nix = {
gc.automatic = false;
settings = {
auto-optimise-store = true;
builders-use-substitutes = true;
allowed-users = ["@wheel"];
trusted-users = ["@wheel"];
commit-lockfile-summary = "Update flake.lock";
accept-flake-config = true;
keep-derivations = true;
keep-outputs = true;
warn-dirty = false;
sandbox = true;
max-jobs = "auto";
log-lines = 30;
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://cache.nixos.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
};
nixpkgs = {
config = {
allowUnfree = true;
allowBroken = true;
};
};
}

View File

@@ -6,7 +6,8 @@
modesetting.enable = true; modesetting.enable = true;
powerManagement.enable = false; powerManagement.enable = false;
powerManagement.finegrained = false; powerManagement.finegrained = false;
open = true;
nvidiaSettings = true; nvidiaSettings = true;
open = false;
package = config.boot.kernelPackages.nvidiaPackages.production;
}; };
} }

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
hardware.graphics.extraPackages = with pkgs; [
mesa
];
}

View File

@@ -0,0 +1,13 @@
{ ... }: {
imports = [
./cups
./docker
./flatpak
./libvirtd
./podman
./polkit
./ssh
./steam
./tailscale
];
}

View File

@@ -0,0 +1,19 @@
{ pkgs, config, lib, ... }:
{
virtualisation.containers.enable = true;
virtualisation.docker = {
enable = true;
storageDriver = "overlay2";
enableOnBoot = true;
daemon.settings = {
features.cdi = true;
};
};
environment.systemPackages = with pkgs; [
docker
docker-compose
docker-buildx
];
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
services.flatpak.enable = true;
}

View File

@@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
virtualisation.libvirtd = {
enable = true;
allowedBridges = [
"virbr0"
"nm-bridge"
];
qemu.package = pkgs.qemu_full;
};
environment.systemPackages = with pkgs; [
qemu-utils
virt-manager
];
}

View File

@@ -1,4 +0,0 @@
{ ... }:
{
networking.networkmanager.enable = true;
}

View File

@@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }:
{
virtualisation.containers.enable = true;
virtualisation.podman = {
enable = true;
dockerCompat = false;
dockerSocket.enable = false;
defaultNetwork.settings.dns_enabled = true;
};
environment.systemPackages = with pkgs; [
dive
virtiofsd
podman-tui
podman-compose
];
hardware.nvidia-container-toolkit.enable = true;
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.steam ];
programs.steam.enable = true;
programs.steam.fontPackages = with pkgs; [ ipafont ];
}

View File

@@ -0,0 +1,8 @@
{ ... }:
{
services.tailscale = {
enable = true;
openFirewall = true;
interfaceName = "tailscale0";
};
}

6
system/time/default.nix Normal file
View File

@@ -0,0 +1,6 @@
{ systemSettings, ... }:
{
time.timeZone = systemSettings.timezone;
services.timesyncd.enable = true;
}

40
system/users/default.nix Normal file
View File

@@ -0,0 +1,40 @@
{ pkgs, config, userSettings, ... }: {
users.users.${userSettings.username} = {
isNormalUser = true;
description = userSettings.name;
extraGroups = [
"networkmanager"
"wheel"
"docker"
"podman"
"input"
"flatpak"
"dialout"
"video"
"audio"
"libvirtd"
"nix"
"power"
"docker"
];
uid = 1000;
homix = true;
};
users.defaultUserShell = pkgs.bash;
security.sudo = {
enable = true;
extraRules = [
{
commands =
builtins.map (command: {
command = "/run/current-system/sw/bin/${command}";
options = ["NOPASSWD"];
})
[ "poweroff" "reboot" "nixos-rebuild" "systemctl" "nmtui" "tailscale" ];
groups = [ "wheel" ];
}
];
};
}

View File

@@ -4,9 +4,13 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim vim
wget wget
file
eza
jq
killall
htop htop
btop
mc mc
git
parted parted
tree tree
tmux tmux

11
system/vnc/default.nix Normal file
View File

@@ -0,0 +1,11 @@
{ pkgs, lib, ... }:
let
use-vnc = pkgs.callPackage ./use-vnc-script.nix { };
in
{
environment.systemPackages = with pkgs; [
x11vnc
wayvnc
use-vnc
];
}

View File

@@ -0,0 +1,10 @@
{ pkgs, lib, ... }:
pkgs.writeShellScriptBin "use-vnc" ''
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
x11vnc -display :0 &
else
wayvnc 0.0.0.0 &
fi
sudo echo $! > /var/run/use-vnc.pid
''

11
system/wm/default.nix Normal file
View File

@@ -0,0 +1,11 @@
{ ... }: {
imports = [
./dbus
./fonts
./gnome-keyring
./plasma
./sddm
./sway
./xmonad
];
}

View File

@@ -2,7 +2,10 @@
{ {
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
_0xproto _0xproto
nerd-fonts._0xproto
ipafont ipafont
takao takao
noto-fonts-cjk-serif
noto-fonts-cjk-sans
]; ];
} }

View File

@@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
imports = [
../dbus
];
services.desktopManager.plasma6.enable = true;
environment.plasma6.excludePackages = with pkgs.kdePackages; [
plasma-browser-integration
];
}

View File

@@ -1,18 +1,19 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
imports = [ imports = [
./fonts.nix ../fonts
./dbus.nix ../dbus
./gnome-keyring.nix ../gnome-keyring
./xmonad.nix ../xmonad
./sway.nix ../sway
../plasma
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wayland wayland
]; ];
services.displayManager.sddm = { services.displayManager.sddm = lib.mkDefault {
enable = true; enable = true;
wayland.enable = true; wayland.enable = true;
package = pkgs.sddm; package = pkgs.sddm;
@@ -25,6 +26,7 @@
variant = ""; variant = "";
options = ""; options = "";
}; };
dpi = 96;
excludePackages = [ pkgs.xterm ]; excludePackages = [ pkgs.xterm ];
}; };
} }

View File

@@ -1,8 +1,8 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
imports = [ imports = [
./gnome-keyring.nix ../gnome-keyring
./dbus.nix ../dbus
]; ];
programs.sway = { programs.sway = {

View File

@@ -1,21 +0,0 @@
{ pkgs, ... }:
{
imports = [
./fonts.nix
./dbus.nix
./gnome-keyring.nix
];
services.xserver = {
enable = true;
layout = "us";
xkbVariant = "";
xkbOptions = "";
excludePackages = [ pkgs.xterm ];
displayManager.sddm = {
enable = true;
wayland.enable = false;
package = pkgs.sddm;
};
};
}

View File

@@ -1,4 +1,4 @@
{ ... }: { pkgs, ... }:
{ {
services.xserver.windowManager.xmonad = { services.xserver.windowManager.xmonad = {
enable = true; enable = true;

3
user/README.md Normal file
View File

@@ -0,0 +1,3 @@
* `packages`: packages that have zero to few configs and do not require any wrapping
* `wrapped`: packages that is wrapped with extensive config
* `homed`: packages that has configuration on common home directory.

7
user/default.nix Normal file
View File

@@ -0,0 +1,7 @@
{ ... }: {
imports = [
./packages
./homed
./wrapped
];
}

10
user/homed/default.nix Normal file
View File

@@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./git
./polybar
./profile
./xmonad
./zed-editor
];
}

View File

@@ -0,0 +1,19 @@
{ config, pkgs, userSettings, ... }:
{
environment.systemPackages = with pkgs; [
git
gh
];
homix.".gitconfig".text = ''
[user]
email = ${userSettings.email-dev}
name = ${userSettings.name}
[credential "https://github.com"]
helper =
helper = ${pkgs.gh}/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = ${pkgs.gh}/bin/gh auth git-credential
'';
}

View File

@@ -0,0 +1,15 @@
{ pkgs, ... }:
let
bar-launcher = conf: bar:
pkgs.writeShellScriptBin "launch-polybar-${conf}" ''
killall -q polybar
polybar -c ~/.config/polybar/${conf}.ini ${bar} 2>&1 | tee /tmp/polybar.log & disown
'';
in
{
environment.systemPackages = [
pkgs.polybar
(bar-launcher "xmonadAppTray" "apptray")
];
homix.".config/polybar/xmonadAppTray.ini".source = ./xmonadAppTray.ini;
}

View File

@@ -0,0 +1,15 @@
[bar/apptray]
monitor-strict = false
bottom = false
width = 7%
height = 24px
offset-x = 93%
modules-right = tray
foreground = #ffffff00
background = #000000A0
border-color = #000000
[module/tray]
type = internal/tray
tray-spacing = 2px
format-margin = 4px

View File

@@ -0,0 +1,4 @@
{ config, ... }:
{
homix.".profile".source = ./profile;
}

View File

@@ -0,0 +1,3 @@
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share
export PATH="$PATH:${XDG_BIN_HOME:-$HOME/.local/bin}"

View File

@@ -0,0 +1,4 @@
xmobar weather station
- *RJNG*: Gifu Air Base
- *RJGG*: Nagoya Airport

View File

@@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
home.packages = with pkgs; [ environment.systemPackages = with pkgs; [
xmobar xmobar
dunst dunst
networkmanagerapplet networkmanagerapplet
@@ -13,5 +13,6 @@
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
]; ];
home.file.".config/xmonad/xmonad.hs".source = ./xmonad.hs; #homix.".config/xmonad/xmonad.hs".source = ./xmonad.hs;
#homix.".config/xmobar/xmobarrc".source = ./xmobarrc;
} }

View File

@@ -0,0 +1,46 @@
Config { font = "DejaVu Sans Mono 9"
, additionalFonts = ["DejaVu Sans Mono italic 9"]
, borderColor = "black"
, border = FullB
, bgColor = "black"
, fgColor = "whitesmoke"
, alpha = 160
, position = TopSize L 93 24
, textOffset = -1
, iconOffset = -1
, lowerOnStart = True
, pickBroadest = False
, persistent = False
, hideOnStart = False
, iconRoot = "."
, allDesktops = True
, overrideRedirect = False
, textOutputFormat = Ansi
, commands = [ Run Weather "RJNG" ["-t","@<station> <tempC>C, <rh>%, <pressure>hPa",
"-L","18","-H","25",
"--normal","green",
"--high","red",
"--low","lightblue"] 36000
, Run Weather "RJGG" ["-t","@<station> <tempC>C, <rh>%, <pressure>hPa",
"-L", "18", "-H", "25",
"--normal", "green",
"--high", "red",
"--low", "lightblue"] 36000
, Run Network "wlo1" ["-L","0","-H","32",
"--normal","green","--high","red"] 10
, Run Network "enp4s0" ["-L","0","-H","32",
"--normal","green","--high","red"] 10
, Run Cpu ["-L","3","-H","50",
"--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Com "uname" ["-s","-r"] "" 36000
, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% | %cpu% | <box>%memory% * %swap%</box> | %wlo1% - %enp4s0% }\
\{ %RJNG% <fc=#ee9a00><fn=1>%date%</fn></fc>"
}

221
user/homed/xmonad/xmonad.hs Normal file
View File

@@ -0,0 +1,221 @@
import XMonad
import Data.Monoid
import System.Exit
-- XMonad Contrib
import XMonad.Actions.Submap
import XMonad.Actions.Minimize
import XMonad.Actions.CopyWindow
import XMonad.Actions.CycleWS
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.Gaps
import XMonad.Layout.Minimize
import XMonad.Layout.NoBorders
import XMonad.Layout.Tabbed
import XMonad.Util.Run
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.SpawnOnce
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- Main Terminal Program
term :: String
term = "alacritty"
-- Launcher Program
menu :: String
menu = "rofi -show drun"
-- Focus Follows Mouse
ffm :: Bool
ffm = True
-- Click Focus
cf :: Bool
cf = False
-- Border Width
bw :: Dimension
bw = 1
-- Modifier Key (1: left alt, 2: right alt, 4: win key)
modKey :: KeyMask
modKey = mod4Mask
-- workspace
ws :: [String]
ws = ["term", "web", "school", "docs", "code", "debug", "media", "games", "other"]
-- Border Color Normal
bcn :: String
bcn = "#dddddd"
-- Border Color Focused
bcf :: String
bcf = "#ff0000"
-- Key Bindings
keyBinds conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
[
-- Program Launch KB
((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf),
((modm, xK_r), spawn menu),
-- Program Close KB
((modm .|. shiftMask, xK_c), kill),
((modm .|. shiftMask .|. controlMask, xK_c), spawn "xkill"),
-- WM Related KB
((modm, xK_Escape), visualSubmap def $ M.fromList $
[
((shiftMask, xK_q), subName "Exit" $ io exitSuccess),
((0, xK_r), subName "Restart" $ spawn "xmonad --recompile; xmonad --restart")
]
),
-- Layout Related KB
((modm, xK_space), sendMessage NextLayout),
((modm .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf),
((modm, xK_comma), sendMessage (IncMasterN 1)),
((modm, xK_period), sendMessage (IncMasterN (-1))),
((modm, xK_f), sendMessage $ JumpToLayout "Full"),
-- Gaps Related KB
(
(modm, xK_g), visualSubmap def $ M.fromList $
[
((0, xK_g), subName "Toggle Gaps" $ sendMessage $ ToggleGaps),
((controlMask, xK_h), subName "Toggle Left Gap" $ sendMessage $ ToggleGap L),
((controlMask, xK_l), subName "Toggle Right Gap" $ sendMessage $ ToggleGap R),
((controlMask, xK_k), subName "Toggle Up Gap" $ sendMessage $ ToggleGap U),
((controlMask, xK_j), subName "Toggle Down Gap" $ sendMessage $ ToggleGap D),
((0, xK_h), subName "Inc Left Gap" $ sendMessage $ IncGap 5 L),
((0, xK_l), subName "Inc Right Gap" $ sendMessage $ IncGap 5 R),
((0, xK_k), subName "Inc Up Gap" $ sendMessage $ IncGap 5 U),
((0, xK_j), subName "Inc Down Gap" $ sendMessage $ IncGap 5 D),
((shiftMask, xK_h), subName "Dec Left Gap" $ sendMessage $ DecGap 5 L),
((shiftMask, xK_l), subName "Dec Right Gap" $ sendMessage $ DecGap 5 R),
((shiftMask, xK_k), subName "Dec Up Gap" $ sendMessage $ DecGap 5 U),
((shiftMask, xK_j), subName "Dec Down Gap" $ sendMessage $ DecGap 5 D)
]
),
-- Windows Related KB
((modm, xK_a), refresh),
((modm, xK_Tab), windows W.focusDown),
((modm, xK_j), windows W.focusDown),
((modm, xK_k), windows W.focusUp),
((modm, xK_m), windows W.focusMaster),
((modm, xK_Return), windows W.swapMaster),
((modm .|. shiftMask, xK_j), windows W.swapDown),
((modm .|. shiftMask, xK_k), windows W.swapUp),
((modm, xK_h), sendMessage Expand),
((modm, xK_l), sendMessage Shrink),
((modm, xK_t), withFocused $ windows . W.sink),
((modm, xK_m), withFocused minimizeWindow),
((modm .|. shiftMask, xK_m), withLastMinimized maximizeWindowAndFocus),
((modm .|. controlMask, xK_c), windows copyToAll),
((modm .|. controlMask .|. shiftMask, xK_c), killAllOtherCopies),
((modm .|. shiftMask, xK_c), kill1)
]
++
-- Workspace Related KB
[
((modm, xK_Page_Up), nextWS),
((modm, xK_Page_Down), prevWS),
((modm, xK_n), nextWS),
((modm, xK_p), prevWS)
]
++
[
((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask), (copy, controlMask)]
]
mouseBinds (XConfig {XMonad.modMask = modm}) = M.fromList
[
((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster),
((modm, button2), \w -> focus w >> windows W.shiftMaster),
((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster)
]
layouts = avoidStruts(tiled ||| Mirror tiled ||| gaped_tiled ||| tabbed shrinkText tabConfig) ||| noBorders Full ||| gaped_full
where
tiled = minimize(Tall nmaster delta ratio)
gaped_tiled = gaps surrounded_gap $ minimize(Tall nmaster delta ratio)
gaped_full = gaps surrounded_gap $ noBorders Full
surrounded_gap = [(U,10),(D,10),(L,10),(R,10)]
nmaster = 1
ratio = 1/2
delta = 3/100
tabConfig = def {
fontName = "xft:DejaVu Sans Mono",
activeColor = "#aaaaaa",
inactiveColor = "#8a8a8a"
}
-- Manage Hook
mh = composeAll
[
title =? "Picture-in-Picture" --> doSideFloat SE,
isFullscreen --> doFullFloat,
isDialog --> doCenterFloat
]
-- Event Hook
eh = mempty
-- Log Hook
lh h = dynamicLogWithPP $ statbarPipe { ppOutput = hPutStrLn h }
-- Startup Hook
sh = do
spawn "launch-polybar-xmonadAppTray"
spawnOnce "feh --bg-scale ~/画像/wallpaper/85444653_p0.jpg"
-- Status bar used in WM
statbar :: String
statbar = "xmobar"
statbarPipe = xmobarPP {
ppOrder = \(ws:l:t:_) -> [ws,t],
ppCurrent = xmobarColor "red" "black" . \s -> wrap "[" "]" (s ++ ""),
ppUrgent = xmobarColor "gray" "black" . \s -> wrap "{" "}" (s ++ ""),
ppVisible = xmobarColor "red" "black" . \s -> pad (s ++ ""),
ppHidden = xmobarColor "gray" "black" . \s -> pad (s ++ ""),
ppHiddenNoWindows = xmobarColor "gray" "black" . \s -> pad (s ++ ""),
ppTitle = xmobarColor "red" "black" . shorten 32,
ppLayout = id,
ppOutput = putStrLn,
ppWsSep = " ",
ppSep = " | "
}
main :: IO()
main = do
wsbar <- spawnPipe statbar
xmonad . docks $ myConfig wsbar
myConfig bar = def {
terminal = term,
focusFollowsMouse = ffm,
clickJustFocuses = cf,
borderWidth = bw,
modMask = modKey,
workspaces = ws,
normalBorderColor = bcn,
focusedBorderColor = bcf,
keys = keyBinds,
mouseBindings = mouseBinds,
layoutHook = layouts,
manageHook = mh <+> manageDocks,
handleEventHook = eh,
logHook = lh bar,
startupHook = sh
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.zed-editor ];
homix.".config/zed/settings.json".source = ./settings.json;
}

View File

@@ -0,0 +1,47 @@
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"assistant": {
"default_model": {
"provider": "ollama",
"model": "mistral:7b"
},
"version": "2"
},
"base_keymap": "VSCode",
"theme": "Gruvbox Material",
"telemetry": {
"metrics": false
},
"vim_mode": true,
"buffer_font_family": "0xProto",
"buffer_font_size": 16,
"ui_font_size": 16,
"tab_size": 4,
"tabs": {
"close_position": "right",
"file_icons": true,
"git_status": true
},
"format_on_save": "off",
"language_models": {
"ollama": {
"api_url": "http://127.0.0.1:11434"
}
},
"terminal": {
"shell": {
"with_arguments": {
"program": "/run/current-system/sw/bin/bash",
"args": []
}
},
"blinking": "on"
}
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
cava
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
chromium
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
dbeaver-bin
];
}

31
user/packages/default.nix Normal file
View File

@@ -0,0 +1,31 @@
{ ... }: {
imports = [
./cava
./chromium
./dbeaver
./firefox
./firefox-dev-edition
./freecad
./fzf
./gimp
./gitui
./inkscape
./kdenlive
./keepassxc
./kicad
./krita
./libreoffice-fresh
./mangohud
./mpv
./obs-studio
./owncloud-client
./pandoc
./python3
./qtcreator
./thunderbird
./tldr
./vlc
./yt-dlp
./zoxide
];
}

View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
firefox-devedition-bin
];
environment.variables = {
MOZ_ENABLE_WAYLAND = 1;
};
}

View File

@@ -0,0 +1,10 @@
{ pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
firefox
];
environment.variables = {
MOZ_ENABLE_WAYLAND = 1;
};
}

View File

@@ -0,0 +1,3 @@
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.freecad ];
}

View File

@@ -0,0 +1,16 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
fzf
];
environment.variables = {
FZF_ALT_C_OPTS = ''
--walker-skip .git,node_modules,target
--preview 'tree -C {}'
'';
FZF_COMPLETION_OPTS = "--border --info=inline";
FZF_COMPLETION_PATH_OPTS = "--walker file,dir,follow,hidden";
FZF_COMPLETION_DIR_OPTS = "--walker dir,follow";
};
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gimp
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gitui
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
inkscape
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
kdePackages.kdenlive
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
keepassxc
];
}

View File

@@ -0,0 +1,3 @@
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.kicad ];
}

View File

@@ -0,0 +1,4 @@
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.krita ];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
libreoffice-fresh
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
mangohud
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
minecraft
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
mpv
];
}

View File

@@ -0,0 +1,6 @@
{ config, pkgs, libs, ... }:
{
environment.systemPackages = with pkgs; [
obs-studio
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
owncloud-client
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
pandoc
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
python311
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
qtcreator
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
thunderbird
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
tldr
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vlc
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
yt-dlp
];
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
zoxide
];
}

5
user/userSettings.nix Normal file
View File

@@ -0,0 +1,5 @@
{
username = "kenryus";
name = "Kenryu Shibata";
email-dev = "kenryudev5894@gmail.com";
}

View File

@@ -1,10 +0,0 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; [
alacritty
];
programs.alacritty.enable = true;
programs.alacritty.settings = {
window.opacity = lib.mkForce 0.85;
};
}

View File

@@ -1,35 +0,0 @@
Config {
font = "IPAGothic 9",
bgColor = "black",
fgColor = "#646464",
position = Top,
border = BottomB,
borderColor = "#646464",
sepChar = "%",
alignSep = "}{",
template = "%multicpu% | %coretemp% | %memory% | %dynnetwork% }{ %date%",
lowerOnStart = True,
hideOnStart = False,
allDesktops = True,
overrideRedirect = True,
pickBroadest = False,
persistent = True,
commands =
[
Run DynNetwork [
"--template", "<dev>: <tx>kB/s|<rx>kB/s",
"--Low", "1000" -- units: B/s,
"--High", "5000" -- units: B/s,
"--low", "darkgreen",
"--normal", "darkorange",
"--high", "darkred"
] 10,
Run MultiCpu [
"--template", "Cpu: <total0>C|<core1>C"
] 10,
]
}

View File

@@ -1,334 +0,0 @@
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
import XMonad
import Data.Monoid
import System.Exit
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- The preferred terminal program, which is used in a binding below and by
-- certain contrib modules.
--
myTerminal = "alacritty"
-- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
-- Whether clicking on a window to focus also passes the click to the window
myClickJustFocuses :: Bool
myClickJustFocuses = False
-- Width of the window border in pixels.
--
myBorderWidth = 1
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
-- ("right alt"), which does not conflict with emacs keybindings. The
-- "windows key" is usually mod4Mask.
--
myModMask = mod1Mask
-- The default number of workspaces (virtual screens) and their names.
-- By default we use numeric strings, but any string may be used as a
-- workspace name. The number of workspaces is determined by the length
-- of this list.
--
-- A tagging example:
--
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
--
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
-- Border colors for unfocused and focused windows, respectively.
--
myNormalBorderColor = "#dddddd"
myFocusedBorderColor = "#ff0000"
------------------------------------------------------------------------
-- Key bindings. Add, modify or remove key bindings here.
--
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- launch a terminal
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
-- launch dmenu
, ((modm, xK_p ), spawn "dmenu_run")
-- launch gmrun
, ((modm .|. shiftMask, xK_p ), spawn "gmrun")
-- close focused window
, ((modm .|. shiftMask, xK_c ), kill)
-- Rotate through the available layout algorithms
, ((modm, xK_space ), sendMessage NextLayout)
-- Reset the layouts on the current workspace to default
, ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
-- Resize viewed windows to the correct size
, ((modm, xK_n ), refresh)
-- Move focus to the next window
, ((modm, xK_Tab ), windows W.focusDown)
-- Move focus to the next window
, ((modm, xK_j ), windows W.focusDown)
-- Move focus to the previous window
, ((modm, xK_k ), windows W.focusUp )
-- Move focus to the master window
, ((modm, xK_m ), windows W.focusMaster )
-- Swap the focused window and the master window
, ((modm, xK_Return), windows W.swapMaster)
-- Swap the focused window with the next window
, ((modm .|. shiftMask, xK_j ), windows W.swapDown )
-- Swap the focused window with the previous window
, ((modm .|. shiftMask, xK_k ), windows W.swapUp )
-- Shrink the master area
, ((modm, xK_h ), sendMessage Shrink)
-- Expand the master area
, ((modm, xK_l ), sendMessage Expand)
-- Push window back into tiling
, ((modm, xK_t ), withFocused $ windows . W.sink)
-- Increment the number of windows in the master area
, ((modm , xK_comma ), sendMessage (IncMasterN 1))
-- Deincrement the number of windows in the master area
, ((modm , xK_period), sendMessage (IncMasterN (-1)))
-- Toggle the status bar gap
-- Use this binding with avoidStruts from Hooks.ManageDocks.
-- See also the statusBar function from Hooks.DynamicLog.
--
-- , ((modm , xK_b ), sendMessage ToggleStruts)
-- Quit xmonad
, ((modm .|. shiftMask, xK_q ), io exitSuccess)
-- Restart xmonad
, ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
-- Run xmessage with a summary of the default keybindings (useful for beginners)
, ((modm .|. shiftMask, xK_slash ), xmessage help)
]
++
--
-- mod-[1..9], Switch to workspace N
-- mod-shift-[1..9], Move client to workspace N
--
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
++
--
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
--
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events
--
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList
-- mod-button1, Set the window to floating mode and move by dragging
[ ((modm, button1), \w -> focus w >> mouseMoveWindow w
>> windows W.shiftMaster)
-- mod-button2, Raise the window to the top of the stack
, ((modm, button2), \w -> focus w >> windows W.shiftMaster)
-- mod-button3, Set the window to floating mode and resize by dragging
, ((modm, button3), \w -> focus w >> mouseResizeWindow w
>> windows W.shiftMaster)
-- you may also bind events to the mouse scroll wheel (button4 and button5)
]
------------------------------------------------------------------------
-- Layouts:
-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
--
-- The available layouts. Note that each layout is separated by |||,
-- which denotes layout choice.
--
myLayout = tiled ||| Mirror tiled ||| Full
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 1/2
-- Percent of screen to increment by when resizing panes
delta = 3/100
------------------------------------------------------------------------
-- Window rules:
-- Execute arbitrary actions and WindowSet manipulations when managing
-- a new window. You can use this to, for example, always float a
-- particular program, or have a client always appear on a particular
-- workspace.
--
-- To find the property name associated with a program, use
-- > xprop | grep WM_CLASS
-- and click on the client you're interested in.
--
-- To match on the WM_NAME, you can use 'title' in the same way that
-- 'className' and 'resource' are used below.
--
myManageHook = composeAll
[ className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat
, resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore ]
------------------------------------------------------------------------
-- Event handling
-- * EwmhDesktops users should change this to ewmhDesktopsEventHook
--
-- Defines a custom handler function for X Events. The function should
-- return (All True) if the default handler is to be run afterwards. To
-- combine event hooks use mappend or mconcat from Data.Monoid.
--
myEventHook = mempty
------------------------------------------------------------------------
-- Status bars and logging
-- Perform an arbitrary action on each internal state change or X event.
-- See the 'XMonad.Hooks.DynamicLog' extension for examples.
--
myLogHook = return ()
------------------------------------------------------------------------
-- Startup hook
-- Perform an arbitrary action each time xmonad starts or is restarted
-- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
-- per-workspace layout choices.
--
-- By default, do nothing.
myStartupHook = return ()
------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this.
--
main = xmonad defaults
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--
-- No need to modify this.
--
defaults = def {
-- simple stuff
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
clickJustFocuses = myClickJustFocuses,
borderWidth = myBorderWidth,
modMask = myModMask,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
-- key bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
handleEventHook = myEventHook,
logHook = myLogHook,
startupHook = myStartupHook
}
-- | Finally, a copy of the default bindings in simple textual tabular format.
help :: String
help = unlines ["The default modifier key is 'alt'. Default keybindings:",
"",
"-- launching and killing programs",
"mod-Shift-Enter Launch xterminal",
"mod-p Launch dmenu",
"mod-Shift-p Launch gmrun",
"mod-Shift-c Close/kill the focused window",
"mod-Space Rotate through the available layout algorithms",
"mod-Shift-Space Reset the layouts on the current workSpace to default",
"mod-n Resize/refresh viewed windows to the correct size",
"mod-Shift-/ Show this help message with the default keybindings",
"",
"-- move focus up or down the window stack",
"mod-Tab Move focus to the next window",
"mod-Shift-Tab Move focus to the previous window",
"mod-j Move focus to the next window",
"mod-k Move focus to the previous window",
"mod-m Move focus to the master window",
"",
"-- modifying the window order",
"mod-Return Swap the focused window and the master window",
"mod-Shift-j Swap the focused window with the next window",
"mod-Shift-k Swap the focused window with the previous window",
"",
"-- resizing the master/slave ratio",
"mod-h Shrink the master area",
"mod-l Expand the master area",
"",
"-- floating layer support",
"mod-t Push window back into tiling; unfloat and re-tile it",
"",
"-- increase or decrease number of windows in the master area",
"mod-comma (mod-,) Increment the number of windows in the master area",
"mod-period (mod-.) Deincrement the number of windows in the master area",
"",
"-- quit, or restart",
"mod-Shift-q Quit xmonad",
"mod-q Restart xmonad",
"mod-[1..9] Switch to workSpace N",
"",
"-- Workspaces & screens",
"mod-Shift-[1..9] Move client to workspace N",
"mod-{w,e,r} Switch to physical/Xinerama screens 1, 2, or 3",
"mod-Shift-{w,e,r} Move client to screen 1, 2, or 3",
"",
"-- Mouse bindings: default actions bound to mouse events",
"mod-button1 Set the window to floating mode and move by dragging",
"mod-button2 Raise the window to the top of the stack",
"mod-button3 Set the window to floating mode and resize by dragging"]

View File

@@ -0,0 +1,25 @@
{ pkgs, ... }:
let
alacrittyconf = pkgs.writeText "alacritty.toml" ''
[window]
opacity = 0.85
[scrolling]
history = 25000
multiplier = 5
[font]
normal = { family = "0xProto Nerd Font Mono", style = "Regular" }
bold = { family = "0xProto Nerd Font Mono", style = "Bold" }
italic = { family = "0xProto Nerd Font Mono", style = "Italic" }
size = 12.00
'';
in
pkgs.symlinkJoin {
name = "alacritty-wrapped";
paths = [ pkgs.alacritty ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/alacritty --add-flags "--config-file ${alacrittyconf}"
'';
}

View File

@@ -0,0 +1,30 @@
{ config, pkgs, ... }:
let
lsCmd = "eza -la --git -s type";
bashrc = pkgs.writeShellScript ".bashrc" ''
[[ $- == *i* ]] || return
eval "$(fzf --bash)"
eval "$(zoxide init bash)"
HISTFILESIZE=100000
HISTSIZE=1000
alias cd=z
alias l="${lsCmd}"
alias ls="${lsCmd}"
alias update-flake="nix flake update"
if [[ ! -v BASH_COMPLETION_VERSINFO ]]; then
. "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
fi
'';
in
pkgs.symlinkJoin {
name = "bash-wrapped";
paths = with pkgs; [ bash bash-completion];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/bash --add-flags "--rcfile ${bashrc}"
'';
}

Some files were not shown because too many files have changed in this diff Show More