Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanashimia committed May 5, 2021
1 parent a64e7ab commit 2127277
Show file tree
Hide file tree
Showing 29 changed files with 231 additions and 137 deletions.
51 changes: 45 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 28 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
description = "Configuration of my nixos machines.";

inputs = {
nixpkgs.url = "/home/kanashimia/nixpkgs"; # "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";

xmonad.url = "github:xmonad/xmonad";
xmonad.flake = false;

xmonad-contrib.url = "github:xmonad/xmonad-contrib";
xmonad-contrib.flake = false;
};

outputs = inputs: {
Expand All @@ -14,19 +21,26 @@
inherit (inputs.nixpkgs) lib;

hosts = with builtins; attrNames (readDir ./hosts);
listNixFilesRecursive = path: with lib; filter (hasSuffix ".nix")
(filesystem.listFilesRecursive path);

mkHost = host: lib.makeOverridable lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
(./hosts + "/${host}")
./overlays
] ++ lib.concatMap listNixFilesRecursive [
./modules
];
specialArgs = { inherit inputs; };
};

listNixFilesRecursive = path: with lib;
filter (hasSuffix ".nix")
(filesystem.listFilesRecursive path);

inputs-overlay = final: prev: { inherit inputs; };

mkHost = host:
lib.makeOverridable lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
{ networking.hostName = host; }
{ nixpkgs.overlays = [ inputs-overlay ]; }
./overlays
] ++ lib.concatMap listNixFilesRecursive [
(./hosts + "/${host}")
./modules
];
specialArgs = { inherit inputs; };
};
in lib.genAttrs hosts mkHost;
};
}
8 changes: 6 additions & 2 deletions hosts/ati-workstation/boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
hardware.enableRedistributableFirmware = true;

boot.loader = {
systemd-boot.enable = true;
systemd-boot = {
enable = true;
editor = false;
consoleMode = "max";
};
timeout = 0;
efi.canTouchEfiVariables = true;
};

#boot.kernelParams = [ "quiet" ];
boot.kernelParams = [ "quiet" ];
}
2 changes: 0 additions & 2 deletions hosts/ati-workstation/networking.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
networking.useDHCP = false;
networking.interfaces.enp2s0.useDHCP = true;

networking.hostName = "ati-workstation";

# systemd master race.
networking.useNetworkd = true;
}
3 changes: 0 additions & 3 deletions hosts/hp-laptop/networking.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
# Networking configuration.
networking.hostName = "hp-laptop";

# Need to make interface use DHCP manually, because systemd.
networking.useDHCP = false;
networking.interfaces.wlan0.useDHCP = true;
Expand Down
4 changes: 1 addition & 3 deletions hosts/personal-server/networking.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# Need to make interface use DHCP manually, because systemd.
# networking.useDHCP = false;
#networking.interfaces.enp2s0.useDHCP = true;

networking.hostName = "personal-server";

# systemd master race.
# networking.useNetworkd = true;
networking.useNetworkd = true;
}
26 changes: 13 additions & 13 deletions modules/audio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

{
# Imagine humanity when this becomes usable.
# services.pipewire = {
# enable = true;
# alsa.enable = true;
# alsa.support32Bit = true;
# jack.enable = true;
# # pulse.enable = true;
# };
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
};

# security.rtkit.enable = true;
systemd.services.rtkit-daemon.serviceConfig.ExecStart = [
Expand All @@ -26,14 +26,14 @@

# Enable ALSA
sound.enable = true;
hardware.pulseaudio.enable = true;
#hardware.pulseaudio.enable = true;

## Enable JACK
services.jack = {
jackd.enable = true;
alsa.enable = false;
loopback.enable = true;
};
#services.jack = {
# jackd.enable = true;
# alsa.enable = false;
# loopback.enable = true;
#};

services.jack.jackd.extraOptions = [ "-R" "-P99" "-dalsa" ];

Expand Down
10 changes: 9 additions & 1 deletion modules/browsers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

{
environment.systemPackages = with pkgs; [
firefox nyxt qutebrowser socat ungoogled-chromium
firefox nyxt qutebrowser socat
];
home-manager.users.kanashimia = {
programs.chromium = {
enable = true;
extensions = [
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; }
];
};
};
}
8 changes: 0 additions & 8 deletions modules/default.nix

This file was deleted.

6 changes: 0 additions & 6 deletions modules/editors/default.nix

This file was deleted.

30 changes: 15 additions & 15 deletions modules/editors/vim/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{ pkgs, ... }:

{
programs.neovim = {
enable = true;
configure = {
customRC = ''
" here your custom configuration goes!
'';
packages.myVimPackage = with pkgs.vimPlugins; {
# loaded on launch
start = [ emmet-vim ];
# manually loadable by calling `:packadd $plugin-name`
opt = [ ];
};
};
};
environment.systemPackages = with pkgs; [ nodejs ];
#programs.neovim = {
# enable = true;
# configure = {
# customRC = ''
# " here your custom configuration goes!
# '';
# packages.myVimPackage = with pkgs.vimPlugins; {
# # loaded on launch
# start = [ emmet-vim ];
# # manually loadable by calling `:packadd $plugin-name`
# opt = [ ];
# };
# };
#};
#environment.systemPackages = with pkgs; [ nodejs ];
}
5 changes: 3 additions & 2 deletions modules/input.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, config, ... }:

{
# Mouse and touchpad configuration.
Expand Down Expand Up @@ -26,13 +26,14 @@
layout = "us(dvorak),us,ru,ua";
};

i18n.inputMethod.enabled = "ibus";
i18n.inputMethod.enabled = "fcitx5";
i18n.inputMethod.fcitx5.addons = with pkgs; [
fcitx5-mozc fcitx5-m17n fcitx5-table-other fcitx5-table-extra
];
i18n.inputMethod.ibus.engines = with pkgs.ibus-engines; [
mozc m17n table table-others
];
services.xserver.displayManager.sessionCommands = "${config.i18n.inputMethod.package}/bin/fcitx5 -d";
#services.xserver.displayManager.sessionCommands = "${pkgs.ibus}/bin/ibus-daemon -drx";

# Use same layout for console.
Expand Down
1 change: 1 addition & 0 deletions modules/profiles/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
kanashimia.xmonad.enable = true;
kanashimia.themes.xresources.enable = true;
}
2 changes: 1 addition & 1 deletion modules/rofi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rofi = self: super: {
rofi = super.rofi.override {
theme = pkgs.substituteAll {
src = ./theme.rasi;
inherit (config.themes.colors)
inherit (config.kanashimia.themes.colors)
background foreground backgroundBr foregroundBr;
};
};
Expand Down
4 changes: 3 additions & 1 deletion modules/shells/bash/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
source ${pkgs.fzf}/share/fzf/key-bindings.bash
'';

environment.variables.HISTCONTROL = "ignoreboth:erasedups";
environment.variables = {
HISTCONTROL = "ignoreboth:erasedups";
};

environment.shellAliases = {
nrs = "sudo nixos-rebuild switch -L";
Expand Down
5 changes: 0 additions & 5 deletions modules/shells/default.nix

This file was deleted.

2 changes: 1 addition & 1 deletion modules/terminals/alacritty/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{
environment.etc."xdg/alacritty/alacritty.yml".source = pkgs.substituteAll ({
src = ./alacritty.yml;
} // config.themes.colors);
} // config.kanashimia.themes.colors);
}
2 changes: 1 addition & 1 deletion modules/terminals/st/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ st = final: prev: {
src = ./config.h;
scroll = "${scroll}/bin/scroll";
font = "Fira Code:size=11";
} // config.themes.colors) );
} // config.kanashimia.themes.colors) );
};
};
in
Expand Down
6 changes: 1 addition & 5 deletions modules/themes/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
with lib;

let
cfg = config.themes;

defaultColors = rec {
foreground = "#d5d5e1";
foregroundBr = "#acaccd";
Expand Down Expand Up @@ -43,9 +41,7 @@ let
};
in
{
options.themes = {
enable = mkEnableOption "custom themes";

options.kanashimia.themes = {
colors = mapAttrs mkColorOption defaultColors;
};
}
21 changes: 21 additions & 0 deletions modules/themes/fonts.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ pkgs, ... }:

{
fonts.fontconfig.defaultFonts.emoji = [
"Twitter Color Emoji"
];

fonts.fonts = with pkgs; [
twemoji-color-font
dejavu_fonts
gyre-fonts
liberation_ttf
xorg.fontmiscmisc
xorg.fontcursormisc
unifont
noto-fonts-cjk
fira-code
];

fonts.enableDefaultFonts = false;
}
Loading

0 comments on commit 2127277

Please sign in to comment.