[feat] Fix the nix config for desktop
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
.PHONY: darwin home default
|
.PHONY: darwin home default nixos
|
||||||
|
|
||||||
default: home
|
default: nixos
|
||||||
|
|
||||||
darwin:
|
darwin:
|
||||||
nix run nix-darwin -- switch --flake ~/.local/share/dotfiles/config/nix
|
# nix run nix-darwin -- switch --flake ~/.local/share/dotfiles/config/nix
|
||||||
|
nix run nix-darwin -- switch --flake .
|
||||||
|
|
||||||
home:
|
home:
|
||||||
nix run home-manager/master -- switch --flake ~/.local/share/dotfiles/config/nix
|
nix --extra-experimental-features "nix-command flakes" run home-manager/master -- switch --flake .
|
||||||
|
|
||||||
|
nixos:
|
||||||
|
nixos-rebuild switch --flake .
|
||||||
|
|||||||
5
config/nix/common/firefox.nix
Normal file
5
config/nix/common/firefox.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{...}: {
|
||||||
|
programs.firefox = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,30 +3,70 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
device,
|
device,
|
||||||
# overlays,
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
start-tmux = (import ../scripts/start-tmux.nix) pkgs;
|
start-tmux = (import ../scripts/start-tmux.nix) pkgs;
|
||||||
in
|
in
|
||||||
# https://mipmip.github.io/home-manager-option-search/
|
# https://mipmip.github.io/home-manager-option-search/
|
||||||
{
|
{
|
||||||
#nixpkgs.overlays = [
|
|
||||||
# (self: super: {
|
|
||||||
# neovim-nightly = overlays.neovim-nightly;
|
|
||||||
# })
|
|
||||||
#];
|
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
./wezterm.nix
|
./wezterm.nix
|
||||||
../linux/hyprland.nix
|
../linux/hyprland.nix
|
||||||
|
./firefox.nix
|
||||||
|
inputs.anyrun.nixosModules.home-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg = {
|
home.packages = with pkgs; [
|
||||||
enable = true;
|
nodejs
|
||||||
};
|
nix-index
|
||||||
|
yubikey-personalization
|
||||||
|
macchina
|
||||||
|
ripgrep
|
||||||
|
fd
|
||||||
|
alejandra
|
||||||
|
dust
|
||||||
|
eza
|
||||||
|
cachix
|
||||||
|
rustup
|
||||||
|
cmake
|
||||||
|
fzf
|
||||||
|
anyrun
|
||||||
|
clang
|
||||||
|
ncpamixer
|
||||||
|
neovim-nightly
|
||||||
|
yubikey-agent
|
||||||
|
(nerdfonts.override {fonts = ["Hasklig"];})
|
||||||
|
mpv
|
||||||
|
# # Adds the 'hello' command to your environment. It prints a friendly
|
||||||
|
# # "Hello, world!" when run.
|
||||||
|
# pkgs.hello
|
||||||
|
|
||||||
|
# # It is sometimes useful to fine-tune packages, for example, by applying
|
||||||
|
# # overrides. You can do that directly here, just don't forget the
|
||||||
|
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
||||||
|
# # fonts?
|
||||||
|
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
||||||
|
|
||||||
|
# # You can also create simple shell scripts directly inside your
|
||||||
|
# # configuration. For example, this adds a command 'my-hello' to your
|
||||||
|
# # environment:
|
||||||
|
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||||
|
# echo "Hello, ${config.home.username}!"
|
||||||
|
# '')
|
||||||
|
];
|
||||||
|
|
||||||
|
xdg.enable = true;
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "uttarayan21";
|
||||||
|
userEmail = "email@uttarayan.me";
|
||||||
|
};
|
||||||
|
nix-index.enableFishIntegration = true;
|
||||||
fish = {
|
fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
@@ -39,10 +79,9 @@ in
|
|||||||
t = "${start-tmux}";
|
t = "${start-tmux}";
|
||||||
};
|
};
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
fnm env | source
|
set fish_greeting
|
||||||
'';
|
'';
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
set fish_greeting
|
|
||||||
${pkgs.macchina.outPath}/bin/macchina
|
${pkgs.macchina.outPath}/bin/macchina
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@@ -134,59 +173,100 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
anyrun = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
plugins = with inputs.anyrun.packages.${pkgs.system}; [
|
||||||
|
rink
|
||||||
|
applications
|
||||||
|
websearch
|
||||||
|
shell
|
||||||
|
translate
|
||||||
|
symbols
|
||||||
|
];
|
||||||
|
x = {fraction = 0.5;};
|
||||||
|
y = {fraction = 0.3;};
|
||||||
|
height = {absolute = 0;};
|
||||||
|
width = {absolute = 1000;};
|
||||||
|
showResultsImmediately = true;
|
||||||
|
layer = "overlay";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfigFiles = {
|
||||||
|
"shell.ron".text = ''
|
||||||
|
Config(
|
||||||
|
prefix: "",
|
||||||
|
shell: None,
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
"handlr.ron".text = ''
|
||||||
|
Config(
|
||||||
|
prefix: "",
|
||||||
|
log: None,
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
"websearch.ron".text = ''
|
||||||
|
Config(
|
||||||
|
prefix: "?"
|
||||||
|
engines: [Google, DuckDuckGo]
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraCss = ''
|
||||||
|
window {
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: rgba(15, 15, 15, .2);
|
||||||
|
border-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: rgba(40, 40, 40, .98);
|
||||||
|
padding: 14px;
|
||||||
|
font-size: 30px;
|
||||||
|
border-color: #000000;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#plugin {
|
||||||
|
color: #efefef;
|
||||||
|
border-color: #000000;
|
||||||
|
border-color: #000000;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main {
|
||||||
|
color: #efefef;
|
||||||
|
border-color: #000000;
|
||||||
|
border-color: #000000;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
home-manager = {
|
home-manager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
home = {
|
home = {
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
username = device.user;
|
username = device.user;
|
||||||
homeDirectory =
|
homeDirectory =
|
||||||
if !isNull (builtins.match ".*-darwin" device.system)
|
if device.isMac
|
||||||
then lib.mkForce "/Users/${device.user}"
|
then lib.mkForce "/Users/${device.user}"
|
||||||
else lib.mkForce "/home/${device.user}";
|
else lib.mkForce "/home/${device.user}";
|
||||||
|
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
macchina
|
|
||||||
ripgrep
|
|
||||||
fd
|
|
||||||
fnm
|
|
||||||
alejandra
|
|
||||||
dust
|
|
||||||
eza
|
|
||||||
cachix
|
|
||||||
rustup
|
|
||||||
cmake
|
|
||||||
# neovim-nightly
|
|
||||||
(nerdfonts.override {fonts = ["Hasklig"];})
|
|
||||||
mpv
|
|
||||||
|
|
||||||
# # Adds the 'hello' command to your environment. It prints a friendly
|
|
||||||
# # "Hello, world!" when run.
|
|
||||||
# pkgs.hello
|
|
||||||
|
|
||||||
# # It is sometimes useful to fine-tune packages, for example, by applying
|
|
||||||
# # overrides. You can do that directly here, just don't forget the
|
|
||||||
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
|
||||||
# # fonts?
|
|
||||||
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
|
||||||
|
|
||||||
# # You can also create simple shell scripts directly inside your
|
|
||||||
# # configuration. For example, this adds a command 'my-hello' to your
|
|
||||||
# # environment:
|
|
||||||
# (pkgs.writeShellScriptBin "my-hello" ''
|
|
||||||
# echo "Hello, ${config.home.username}!"
|
|
||||||
# '')
|
|
||||||
];
|
|
||||||
|
|
||||||
file = {
|
file = {
|
||||||
".config/tmux/sessions".source = ../../tmux/sessions;
|
".config/tmux/sessions".source = ../../tmux/sessions;
|
||||||
".config/nvim".source = ../../nvim;
|
".config/nvim/lua".source = ../../nvim/lua;
|
||||||
|
".config/nvim/init.lua".source = ../../nvim/init.lua;
|
||||||
|
|
||||||
# # You can also set the file content immediately.
|
# # You can also set the file content immediately.
|
||||||
# ".gradle/gradle.properties".text = ''
|
# ".gradle/gradle.properties".text = ''
|
||||||
|
|||||||
79
config/nix/flake.lock
generated
79
config/nix/flake.lock
generated
@@ -1,5 +1,26 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"anyrun": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1701453400,
|
||||||
|
"narHash": "sha256-hI9+KBShsSfvWX7bmRa/1VI20WGat3lDXmbceMZzMS4=",
|
||||||
|
"owner": "Kirottu",
|
||||||
|
"repo": "anyrun",
|
||||||
|
"rev": "e14da6c37337ffa3ee1bc66965d58ef64c1590e5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Kirottu",
|
||||||
|
"repo": "anyrun",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -17,6 +38,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"anyrun",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696343447,
|
||||||
|
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"neovim-nightly-overlay",
|
"neovim-nightly-overlay",
|
||||||
@@ -37,7 +79,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_2": {
|
"flake-parts_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"neovim-nightly-overlay",
|
"neovim-nightly-overlay",
|
||||||
@@ -95,7 +137,7 @@
|
|||||||
},
|
},
|
||||||
"hercules-ci-effects": {
|
"hercules-ci-effects": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"neovim-nightly-overlay",
|
"neovim-nightly-overlay",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
@@ -122,11 +164,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707919853,
|
"lastModified": 1708031129,
|
||||||
"narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=",
|
"narHash": "sha256-EH20hJfNnc1/ODdDVat9B7aKm0B95L3YtkIRwKLvQG8=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "043ba285c6dc20f36441d48525402bcb9743c498",
|
"rev": "3d6791b3897b526c82920a2ab5f61d71985b3cf8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -145,11 +187,11 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "contrib",
|
"dir": "contrib",
|
||||||
"lastModified": 1707941489,
|
"lastModified": 1708127071,
|
||||||
"narHash": "sha256-S5KG+iYMFVHIEfeXSWYei2jcHs6kOfhM1pUoVQ9G/Lw=",
|
"narHash": "sha256-z6z7evR8VBCqM5JGKvRU6oHvdD41j/X+369QiYTzWAk=",
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"repo": "neovim",
|
"repo": "neovim",
|
||||||
"rev": "d09957e0a06f350443c750d9838b5f1016c0cccc",
|
"rev": "5fd1bac65ed07310eda5fd976b651cc493002849",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -162,17 +204,17 @@
|
|||||||
"neovim-nightly-overlay": {
|
"neovim-nightly-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts_2",
|
||||||
"hercules-ci-effects": "hercules-ci-effects",
|
"hercules-ci-effects": "hercules-ci-effects",
|
||||||
"neovim-flake": "neovim-flake",
|
"neovim-flake": "neovim-flake",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707955468,
|
"lastModified": 1708128234,
|
||||||
"narHash": "sha256-ZVka2bcB1AQTiVWqp2yH9Rnsd4Tvpcf5NXXzJIp7QNE=",
|
"narHash": "sha256-NR/X3NlzS4G5XY2ZkdfXdPyEDU0OZdcF+2tElSbm5RI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "neovim-nightly-overlay",
|
"repo": "neovim-nightly-overlay",
|
||||||
"rev": "0b6b4afc71e14d7f17f4e4a367ce271b9d398432",
|
"rev": "957f6857d74f012760dac4437cc03e6475c69d81",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -203,11 +245,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707877513,
|
"lastModified": 1708093448,
|
||||||
"narHash": "sha256-sp0w2apswd3wv0sAEF7StOGHkns3XUQaO5erhWFZWXk=",
|
"narHash": "sha256-gohEm3/NVyu7WINFhRf83yJH8UM2ie/KY9Iw3VN6fiE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "89653a03e0915e4a872788d10680e7eec92f8600",
|
"rev": "c7763249f02b7786b4ca36e13a4d7365cfba162f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -219,11 +261,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707689078,
|
"lastModified": 1708118438,
|
||||||
"narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
|
"narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
|
"rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -235,6 +277,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"anyrun": "anyrun",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||||
|
|||||||
@@ -2,33 +2,46 @@
|
|||||||
description = "Home Manager configuration of fs0c131y";
|
description = "Home Manager configuration of fs0c131y";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# Specify the source of Home Manager and Nixpkgs.
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-darwin = {
|
nix-darwin = {
|
||||||
url = "github:LnL7/nix-darwin";
|
url = "github:LnL7/nix-darwin";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||||
# flake-utils.url = "github:numtide/flake-utils";
|
anyrun = {
|
||||||
|
url = "github:Kirottu/anyrun";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
# nixos,
|
||||||
home-manager,
|
home-manager,
|
||||||
nix-darwin,
|
nix-darwin,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
|
anyrun,
|
||||||
|
neovim-nightly-overlay,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
devices = [
|
config_devices = [
|
||||||
{
|
{
|
||||||
name = "mirai";
|
name = "mirai";
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
user = "fs0c131y";
|
user = "fs0c131y";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "ryu";
|
||||||
|
system = "x86_64-linux";
|
||||||
|
user = "servius";
|
||||||
|
isNix = true;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "genzai";
|
name = "genzai";
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
@@ -45,15 +58,69 @@
|
|||||||
user = "deck";
|
user = "deck";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
linux = builtins.filter (x: x.system == "x86_64-linux") devices;
|
|
||||||
darwin = builtins.filter (x: x.system == "aarch64-darwin") devices;
|
mkDevice = {device, ...}: {
|
||||||
|
isLinux = !isNull (builtins.match ".*-linux" device.system);
|
||||||
|
isNix =
|
||||||
|
if (builtins.hasAttr "isNix" device)
|
||||||
|
then device.isNix
|
||||||
|
else false;
|
||||||
|
isMac = !isNull (builtins.match ".*-darwin" device.system);
|
||||||
|
system = device.system;
|
||||||
|
name = device.name;
|
||||||
|
user = device.user;
|
||||||
|
};
|
||||||
|
|
||||||
|
devices = builtins.map (device: mkDevice {inherit device;}) config_devices;
|
||||||
|
|
||||||
|
nixos_devices = builtins.filter (x: x.isNix) devices;
|
||||||
|
linux_devices = builtins.filter (x: x.isLinux) devices;
|
||||||
|
darwin_devices = builtins.filter (x: x.isMac) devices;
|
||||||
|
|
||||||
|
anyrun-overlay = final: prev: {
|
||||||
|
anyrun = inputs.anyrun.packages.${prev.system}.anyrun;
|
||||||
|
};
|
||||||
|
overlays = [
|
||||||
|
inputs.neovim-nightly-overlay.overlay
|
||||||
|
anyrun-overlay
|
||||||
|
# inputs.anyrun.overlays
|
||||||
|
];
|
||||||
in {
|
in {
|
||||||
|
nixosConfigurations =
|
||||||
|
builtins.listToAttrs
|
||||||
|
(builtins.map
|
||||||
|
(device: {
|
||||||
|
name = device.name;
|
||||||
|
value = nixpkgs.lib.nixosSystem {
|
||||||
|
system = device.system;
|
||||||
|
# system.packages = [anyrun.packages.${device.system}.anyrun];
|
||||||
|
specialArgs = {inherit device;};
|
||||||
|
modules = [
|
||||||
|
{nixpkgs.overlays = overlays;}
|
||||||
|
./nixos/configuration.nix
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
inherit device;
|
||||||
|
};
|
||||||
|
users.${device.user}.imports = [./common/home.nix];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
nixos_devices);
|
||||||
|
|
||||||
homeConfigurations = builtins.listToAttrs (builtins.map
|
homeConfigurations = builtins.listToAttrs (builtins.map
|
||||||
(device: {
|
(device: {
|
||||||
name = device.user;
|
name = device.user;
|
||||||
value = let
|
value = let
|
||||||
pkgs = nixpkgs.legacyPackages.${device.system};
|
pkgs = nixpkgs.legacyPackages.${device.system};
|
||||||
overlays = [inputs.neovim-nightly-overlay.overlay];
|
|
||||||
in
|
in
|
||||||
home-manager.lib.homeManagerConfiguration {
|
home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
@@ -61,6 +128,7 @@
|
|||||||
inherit device;
|
inherit device;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
|
{nixpkgs.overlays = overlays;}
|
||||||
./common/home.nix
|
./common/home.nix
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
@@ -68,7 +136,7 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
linux);
|
linux_devices);
|
||||||
|
|
||||||
darwinConfigurations =
|
darwinConfigurations =
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
@@ -77,15 +145,14 @@
|
|||||||
name = device.name;
|
name = device.name;
|
||||||
value = let
|
value = let
|
||||||
pkgs = nixpkgs.legacyPackages.${device.system};
|
pkgs = nixpkgs.legacyPackages.${device.system};
|
||||||
overlays = [inputs.neovim-nightly-overlay.overlay];
|
|
||||||
in
|
in
|
||||||
nix-darwin.lib.darwinSystem {
|
nix-darwin.lib.darwinSystem {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
{nixpkgs.overlays = overlays;}
|
||||||
./darwin
|
./darwin
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = overlays;
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
@@ -98,6 +165,6 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
darwin);
|
darwin_devices);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
129
config/nix/nixos/configuration.nix
Normal file
129
config/nix/nixos/configuration.nix
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
# 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
|
||||||
|
];
|
||||||
|
|
||||||
|
# Bootloader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "ryu"; # Define your hostname.
|
||||||
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
|
services.udev.packages = [pkgs.yubikey-personalization pkgs.yubikey-personalization-gui];
|
||||||
|
services.yubikey-agent.enable = true;
|
||||||
|
|
||||||
|
# Configure network proxy if necessary
|
||||||
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
# Enable networking
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Asia/Kolkata";
|
||||||
|
|
||||||
|
i18n.supportedLocales = [
|
||||||
|
"en_US.UTF-8/UTF-8"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
i18n.extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "en_US.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||||
|
LC_MEASUREMENT = "en_US.UTF-8";
|
||||||
|
LC_MONETARY = "en_US.UTF-8";
|
||||||
|
LC_NAME = "en_US.UTF-8";
|
||||||
|
LC_NUMERIC = "en_US.UTF-8";
|
||||||
|
LC_PAPER = "en_US.UTF-8";
|
||||||
|
LC_TELEPHONE = "en_US.UTF-8";
|
||||||
|
LC_TIME = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Configure keymap in X11
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us";
|
||||||
|
variant = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
|
users.users.servius = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Uttarayan";
|
||||||
|
extraGroups = ["networkmanager" "wheel"];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow unfree packages
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
fonts.fontDir.enable = true;
|
||||||
|
|
||||||
|
# List packages installed in system profile. To search, run:
|
||||||
|
# $ nix search wget
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||||
|
# wget
|
||||||
|
hyprland
|
||||||
|
foot
|
||||||
|
git
|
||||||
|
fish
|
||||||
|
nushellFull
|
||||||
|
(pkgs.wrapFirefox (pkgs.firefox-unwrapped.override {pipewireSupport = true;}) {})
|
||||||
|
gnumake
|
||||||
|
python3
|
||||||
|
(nerdfonts.override {fonts = ["FiraCode" "Hasklig"];})
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
hyprland.enable = true;
|
||||||
|
yubikey-touch-detector.enable = true;
|
||||||
|
hyprland.xwayland.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
# started in user sessions.
|
||||||
|
# programs.mtr.enable = true;
|
||||||
|
# programs.gnupg.agent = {
|
||||||
|
# enable = true;
|
||||||
|
# enableSSHSupport = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
# services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
|
nix.settings.extra-experimental-features = "nix-command flakes";
|
||||||
|
}
|
||||||
38
config/nix/nixos/hardware-configuration.nix
Normal file
38
config/nix/nixos/hardware-configuration.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# 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 = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/bcaa8c53-6c04-43e0-bf2a-97d8c0f572d9";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/4E27-DAC0";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
@@ -91,13 +91,14 @@ vim.o.completeopt = 'menu,menuone,noselect'
|
|||||||
-- }
|
-- }
|
||||||
-- vim.g.rooter_manual_only = 1
|
-- vim.g.rooter_manual_only = 1
|
||||||
|
|
||||||
local fnm_dir = os.getenv("FNM_DIR") or "/Users/fs0c131y/Library/Application Support/fnm"
|
-- local fnm_dir = os.getenv("FNM_DIR") or "/Users/fs0c131y/Library/Application Support/fnm"
|
||||||
|
|
||||||
if vim.fn.has('win32') == 1 then
|
-- if vim.fn.has('win32') == 1 then
|
||||||
vim.g.copilot_node_command = fnm_dir .. "/node-versions/v17.9.1/installation/node.exe"
|
-- vim.g.copilot_node_command = fnm_dir .. "/node-versions/v17.9.1/installation/node.exe"
|
||||||
else
|
-- else
|
||||||
vim.g.copilot_node_command = fnm_dir .. "/node-versions/v17.9.1/installation/bin/node"
|
-- vim.g.copilot_node_command = fnm_dir .. "/node-versions/v17.9.1/installation/bin/node"
|
||||||
end
|
-- end
|
||||||
|
vim.g.copilot_node_command = "node"
|
||||||
|
|
||||||
vim.g.copilot_no_tab_map = true
|
vim.g.copilot_no_tab_map = true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user