started new config

This commit is contained in:
2025-12-28 14:48:30 +09:00
commit a743f2c943
17 changed files with 661 additions and 0 deletions

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# NixOS Config flake

7
assets/README.md Normal file
View File

@@ -0,0 +1,7 @@
# Static Assets for ricing
All of stuff(Wallpapers, etc.) packaged in single nix deriv.
## Sources
* ``

8
assets/default.nix Normal file
View File

@@ -0,0 +1,8 @@
stdenv.mkDerivation {
name = "ricing-assets";
src = ./.;
installPhase = ''
mkdir -p $out/share/wallpapers
cp -r wallpapers/ $out/share/wallpapers
'';
}

181
flake.lock generated Normal file
View File

@@ -0,0 +1,181 @@
{
"nodes": {
"fetchurl-sources": {
"flake": false,
"locked": {
"path": "./consumer-overridable/fetchurl-sources.nix",
"type": "path"
},
"original": {
"path": "./consumer-overridable/fetchurl-sources.nix",
"type": "path"
},
"parent": [
"xlibre-overlay"
]
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1762980239,
"narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "52a2caecc898d0b46b2b905f058ccc5081f842da",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1766553861,
"narHash": "sha256-ZbnG01yA3O8Yr1vUm3+NQ2qk9iRhS5bloAnuXHHy7+c=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0999ed8f965bbbd991437ad9c5ed3434cecbc30e",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1766568855,
"narHash": "sha256-UXVtN77D7pzKmzOotFTStgZBqpOcf8cO95FcupWp4Zo=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "c5db9569ac9cc70929c268ac461f4003e3e5ca80",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1766622938,
"narHash": "sha256-Eovt/DOCYjFFBZuYbbG9j5jhklzxdNbUGVYYxh3lG3s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5900a0a8850cbba98e16d5a7a6ed389402dfcf4f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1761765539,
"narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "719359f4562934ae99f5443f20aa06c2ffff91fc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"xlibre-overlay": "xlibre-overlay"
}
},
"systems": {
"flake": false,
"locked": {
"path": "./systems.nix",
"type": "path"
},
"original": {
"path": "./systems.nix",
"type": "path"
},
"parent": [
"xlibre-overlay"
]
},
"xlibre-drivers-overlay-choice": {
"flake": false,
"locked": {
"path": "./consumer-overridable/drivers-overlay-choice.nix",
"type": "path"
},
"original": {
"path": "./consumer-overridable/drivers-overlay-choice.nix",
"type": "path"
},
"parent": [
"xlibre-overlay"
]
},
"xlibre-overlay": {
"inputs": {
"fetchurl-sources": "fetchurl-sources",
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems",
"xlibre-drivers-overlay-choice": "xlibre-drivers-overlay-choice",
"xserver-meson-flags": "xserver-meson-flags"
},
"locked": {
"lastModified": 1766204441,
"narHash": "sha256-CKoWqMDv7O81q6v6RTUGfMilx5aulOCw+HHdtkJM1qc=",
"ref": "refs/heads/main",
"rev": "bb35b081bb7256cbafb1c53c911985d86f51da04",
"revCount": 140,
"type": "git",
"url": "https://codeberg.org/takagemacoed/xlibre-overlay"
},
"original": {
"type": "git",
"url": "https://codeberg.org/takagemacoed/xlibre-overlay"
}
},
"xserver-meson-flags": {
"flake": false,
"locked": {
"path": "./consumer-overridable/xserver-meson-flags.nix",
"type": "path"
},
"original": {
"path": "./consumer-overridable/xserver-meson-flags.nix",
"type": "path"
},
"parent": [
"xlibre-overlay"
]
}
},
"root": "root",
"version": 7
}

28
flake.nix Normal file
View File

@@ -0,0 +1,28 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
xlibre-overlay = {
url = "git+https://codeberg.org/takagemacoed/xlibre-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, ... }: {
nixosModules = {
hm = inputs.home-manager.nixosModules.home-manager;
hmConfig = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users."bitbang" = ./home/default.nix;
};
};
};
nixosConfigurations = import ./hosts inputs;
};
}

37
home/cmd_tools.nix Normal file
View File

@@ -0,0 +1,37 @@
{ config, pkgs, lib, ... }:
{
programs.eza = {
enable = true;
git = true;
icons = "always";
enableZshIntegration = true;
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
tmux.enableShellIntegration = true;
};
programs.bat = {
enable = true;
config = {
tabs = "4";
wrap = "character";
italic-text = "never";
theme = "ansi";
};
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [
"--cmd cd"
];
};
programs.gitui = {
enable = true;
};
}

17
home/default.nix Normal file
View File

@@ -0,0 +1,17 @@
{ config, pkgs, lib, ... }:
let
name = "bitbang";
in
{
imports = [
./i3.nix
./vim.nix
];
home = {
username = name;
homeDirectory = "/home/${name}";
stateVersion = "25.11";
};
}

80
home/i3.nix Normal file
View File

@@ -0,0 +1,80 @@
{ config, pkgs, lib, ... }:
let
modKey = "Mod1";
UP = "k";
DOWN = "j";
LEFT = "h";
RIGHT = "l";
MENU = "rofi -show drun";
TERM = "alacritty";
EXIT = "i3-nagbar -t warning -m 'Exit i3?' -B 'Yes' 'i3-msg exit'";
in
{
xsession.windowManager.i3 = {
enable = true;
config = {
modifier = modKey;
menu = MENU;
terminal = TERM;
workspaceLayout = "tabbed";
modes = {
resize = {
"${UP}" = "resize shrink height 10 px or 10 ppt";
"${DOWN}" = "resize grow height 10 px or 10 ppt";
"${LEFT}" = "resize shrink width 10 px or 10 ppt";
"${RIGHT}" = "resize grow width 10 px or 10 ppt";
Escape = "mode default";
};
};
keybindings = {
"${modKey}+Return" = "exec ${TERM}";
"${modKey}+d" = "exec ${MENU}";
"${modKey}+Shift+q" = "kill";
"${modKey}+${LEFT}" = "focus left";
"${modKey}+${RIGHT}" = "focus right";
"${modKey}+${UP}" = "focus up";
"${modKey}+${DOWN}" = "focus down";
"${modKey}+Shift+${LEFT}" = "move left";
"${modKey}+Shift+${RIGHT}" = "move right";
"${modKey}+Shift+${UP}" = "move up";
"${modKey}+Shift+${DOWN}" = "move down";
"${modKey}+y" = "split h";
"${modKey}+t" = "split v";
"${modKey}+f" = "fullscreen toggle";
"${modKey}+s" = "layout stacking";
"${modKey}+w" = "layout tabbed";
"${modKey}+e" = "layout split";
"${modKey}+Shift+space" = "floating toggle";
"${modKey}+space" = "focus mode_toggle";
"${modKey}+Shift+minus" = "move scratchpad";
"${modKey}+n" = "workspace next";
"${modKey}+p" = "workspace prev";
"${modKey}+Shift+c" = "reload";
"${modKey}+Shift+r" = "restart";
"${modKey}+Shift+e" = "exec ${EXIT}";
"${modKey}+r" = "mode resize";
"${modKey}+1" = ''workspace number "1"'';
"${modKey}+2" = ''workspace number "2"'';
"${modKey}+3" = ''workspace number "3"'';
"${modKey}+4" = ''workspace number "4"'';
"${modKey}+5" = ''workspace number "5"'';
"${modKey}+6" = ''workspace number "6"'';
"${modKey}+7" = ''workspace number "7"'';
"${modKey}+8" = ''workspace number "8"'';
"${modKey}+9" = ''workspace number "9"'';
"${modKey}+0" = ''workspace number "10"'';
"${modKey}+Shift+1" = ''move container to workspace number "1"'';
"${modKey}+Shift+2" = ''move container to workspace number "2"'';
"${modKey}+Shift+3" = ''move container to workspace number "3"'';
"${modKey}+Shift+4" = ''move container to workspace number "4"'';
"${modKey}+Shift+5" = ''move container to workspace number "5"'';
"${modKey}+Shift+6" = ''move container to workspace number "6"'';
"${modKey}+Shift+7" = ''move container to workspace number "7"'';
"${modKey}+Shift+8" = ''move container to workspace number "8"'';
"${modKey}+Shift+9" = ''move container to workspace number "9"'';
"${modKey}+Shift+0" = ''move container to workspace number "10"'';
};
};
};
}

9
home/media.nix Normal file
View File

@@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
mpv
vlc
ffmpeg
kdenlive
];
}

14
home/tmux.nix Normal file
View File

@@ -0,0 +1,14 @@
{ config, pkgs, lib, ... }:
{
programs.tmux = {
enable = true;
clock24 = true;
keyMode = "vi";
newSession = true;
historyLimit = 10000;
baseIndex = 1;
disableConfirmationPrompt = false;
customPaneNavigationAndResize = true;
terminal = "tmux-direct";
};
}

25
home/vim.nix Normal file
View File

@@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
{
programs.vim.enable = true;
programs.vim.settings = {
expandtab = true;
shiftwidth = 4;
tabstop = 4;
history = 128;
ignorecase = true;
smartcase = true;
number = true;
relativenumber = true;
};
programs.vim.extraConfig = ''
set encoding=utf-8
set fileencodings=utf-8,euc-jp,sjis
set autoindent
set smartindent
set wrap
set incsearch
syntax enable
'';
}

30
hosts/default.nix Normal file
View File

@@ -0,0 +1,30 @@
{ self, nixpkgs, ... }:
let
inherit (self) inputs;
common-intel = inputs.nixos-hardware.nixosModules.common-cpu-intel;
framework16 = inputs.nixos-hardware.nixosModules.framework-16-7040-amd;
# mkHost - String -> Boolean -> Attr -> Attr - Create nixos system attributes
# @param name - String - Name of the system
# @param isDesktop - Boolean - If set true, adds xlibre overlays to modules
# @param machine - Attr - Attribute from nixos-hardware nixos Module for setting machine's preset
mkHost = name: isDesktop: machine:
nixpkgs.lib.nixosSystem {
modules = [
./${name}
../overlays
machine
] ++ builtins.attrValues self.nixosModules ++ (if isDesktop then [
inputs.xlibre-overlay.nixosModules.overlay-xlibre-xserver
inputs.xlibre-overlay.nixosModules.overlay-all-xlibre-drivers
] else []);
specialArgs = {
inherit inputs;
};
};
in
{
"virtual-bird" = mkHost "virtual-bird" true common-intel;
}

View File

@@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
../../profiles/base.nix
../../profiles/desktop.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.xserver.windowManager.i3.enable = true;
environment.systemPackages = with pkgs; [
rofi
dunst
vim
tmux
];
networking.hostName = "virtual-bird";
networking.firewall.enable = true;
system.stateVersion = "25.11"; # Did you read the comment?
}

View File

@@ -0,0 +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 + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9705a174-c3ce-44f0-98eb-48d801e91cde";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3351-CE12";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/2bf99498-58e9-429d-9636-115c8c06316a"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

4
overlays/default.nix Normal file
View File

@@ -0,0 +1,4 @@
{ config, pkgs, lib, ... }:
{
nixpkgs.overlays = [];
}

109
profiles/base.nix Normal file
View File

@@ -0,0 +1,109 @@
{ config, lib, pkgs, ... }:
{
networking.networkmanager.enable = lib.mkDefault true;
time.timeZone = "Asia/Tokyo";
i18n = {
defaultLocale = "en_US.UTF-8";
defaultCharset = "UTF-8";
extraLocales = [
"ja_JP.UTF-8/UTF-8"
"ja_JP.EUC-JP/EUC-JP"
];
};
services.pipewire = {
enable = true;
pulse.enable = true;
};
services.openssh = {
enable = true;
};
programs.mtr.enable = true;
programs.gnupg = {
agent = {
enable = true;
enableSSHSupport = true;
};
};
hardware.gpgSmartcards.enable = true;
users.users.bitbang = {
isNormalUser = true;
extraGroups = [ "wheel" "video" "audio" "nix" "dialout" "networkmanager" ];
};
programs.zoxide = {
enable = true;
enableBashIntegration = false;
enableZshIntegration = true;
};
programs.tmux = {
enable = true;
clock24 = true;
baseIndex = 1;
keyMode = "vi";
customPaneNavigationAndResize = true;
newSession = true;
historyLimit = 10000;
terminal = "tmux-direct";
};
programs.bat = {
enable = true;
};
programs.nix-ld = {
enable = true;
libraries = with pkgs; [
zlib
zstd
stdenv.cc.cc
curl
openssl
attr
libssh
bzip2
libxml2
acl
libsodium
util-linux
xz
systemd
ffmpeg
];
};
nix.gc = {
automatic = true;
dates = "monthly";
persistent = true;
};
nix.settings = {
cores = 4;
sandbox = true;
allowed-users = [ "@wheel" ];
trusted-users = [ "@wheel" ];
log-lines = 50;
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://cache.nixos.org"
];
accept-flake-config = true;
};
environment.systemPackages = with pkgs; [
micro
wget
git
btop
fastfetch
stow
];
}

48
profiles/desktop.nix Normal file
View File

@@ -0,0 +1,48 @@
{ config, pkgs, lib, ... }:
{
i18n.inputMethod = {
enable = true;
enableGtk3 = true;
enableGtk2 = true;
type = "fcitx5";
fcitx5 = {
addons = with pkgs; [
fcitx5-skk
];
};
};
services.xserver = {
enable = true;
xkb = {
layout = "us";
};
resolutions = [
{ x = 1920; y = 1080; }
{ x = 2560; y = 1600; }
];
dpi = 96;
displayManager.lightdm = {
enable = true;
greeters.gtk = {
enable = true;
};
};
};
services.libinput = {
enable = true;
touchpad = {
tapping = true;
scrollMethod = "twofinger";
disableWhileTyping = true;
accelProfile = "flat";
accelSpeed = "0.5";
};
};
environment.systemPackages = with pkgs; [
alacritty
xfe
];
}