Compare commits

...

3 Commits

Author SHA1 Message Date
aaf19ee844 massive rewrite using flake-parts
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-12-08 01:00:12 +05:30
dfd8c57b60 home/natto: emacs: use firacode and misc changes
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-12-06 19:31:40 +05:30
42843126e3 hosts and modules restructuring
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-12-06 19:31:40 +05:30
64 changed files with 376 additions and 613 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

289
flake.lock generated
View File

@@ -16,17 +16,17 @@
"type": "gitlab"
}
},
"emacs": {
"emacs-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1669924706,
"narHash": "sha256-5YdsL731ESOT8wZ6aBPG7V2AZxYglK/N8JJopp9R+Ow=",
"lastModified": 1670438727,
"narHash": "sha256-c8SAz45BtQTZLxX0BRoj7aGlk6jogjlTE7Tj40lQr6Q=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "7419dbeb120e44bfb8cbbb74f1b4e77b3f8401ab",
"rev": "e9c4d10bbb4e810cbfe5e31248fe835e08efb35a",
"type": "github"
},
"original": {
@@ -51,6 +51,24 @@
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1668450977,
"narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
@@ -102,11 +120,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1669825171,
"narHash": "sha256-HxlZHSiRGXnWAFbIJMeujqBe2KgACYx5XDRY0EA9P+4=",
"lastModified": 1670280307,
"narHash": "sha256-3x+0whP1nCz5adQMIsBA3L9fI/ABOpRUJdbw0AmxBnU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "478610aa37c8339eacabfa03f07dacf5574edd47",
"rev": "2af0d07678fc15612345e0dd55337550dcf6465f",
"type": "github"
},
"original": {
@@ -115,29 +133,10 @@
"type": "github"
}
},
"home-manager-stable": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1651519540,
"narHash": "sha256-3k6p8VsTwwRPQjE8rrMh+o2AZACZn/eeYJ7ivdQ/Iro=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d93d56ab8c1c6aa575854a79b9d2f69d491db7d0",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-21.11",
"repo": "home-manager",
"type": "github"
}
},
"mailserver": {
"inputs": {
"blobs": "blobs",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_3",
"nixpkgs-22_05": "nixpkgs-22_05",
"utils": "utils_2"
},
@@ -155,25 +154,9 @@
"type": "gitlab"
}
},
"master": {
"locked": {
"lastModified": 1669939897,
"narHash": "sha256-DjVJK3t6HRxul4k6pNwfgGpjF5PirmZjgFjRvBTrlAk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "67f5368df158a7ef2f020ccca17f88ab20caa786",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nbfc": {
"inputs": {
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_4",
"utils": "utils_3"
},
"locked": {
@@ -194,17 +177,17 @@
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nvim",
"nvim-overlay",
"nixpkgs"
]
},
"locked": {
"dir": "contrib",
"lastModified": 1669866653,
"narHash": "sha256-Xtis0StzXynHe7gnqgcl4sm2JHva9Y+KlVjaOaf/S3w=",
"lastModified": 1670395896,
"narHash": "sha256-Nz4ZCPER+Z1JGMf5XDJAcssr/wg6h7PASwy6baym8kY=",
"owner": "neovim",
"repo": "neovim",
"rev": "1390e97c200ee265f72a4e2d7ec1a47fd65462ee",
"rev": "0caae2376e6c8f6665143e77e4e7a0cdf2b054c4",
"type": "github"
},
"original": {
@@ -216,14 +199,14 @@
},
"nix-gaming": {
"inputs": {
"nixpkgs": "nixpkgs_6"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1669128192,
"narHash": "sha256-iBkK3E/S4XfQDi+2hr8WWitiIUZ5EWsmfTcR4jbIPNA=",
"lastModified": 1670183910,
"narHash": "sha256-qRZaqZ+KdxT7hXQBmRHxrpE4MqwiaBOQtOAxuJKtS0U=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "9f96bd578ee5c1511535adccd295383d79fb791d",
"rev": "ba6dd04cdb03d796054d0d2bb81f949690fc6efa",
"type": "github"
},
"original": {
@@ -234,11 +217,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1669261230,
"narHash": "sha256-AjddxRPd5y5jge77281P3O8+Cnafj842Xg59rwV4x+0=",
"lastModified": 1670047204,
"narHash": "sha256-5NcSGchQbl9DKMQ31qmgfscmrAg7qilJF/no2nBSRzs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8e8b5f3b1e899bf5d250279578c0283705b8cdb4",
"rev": "809f15f2e7fd66c3d3ba6aabffa946fbd67f93fc",
"type": "github"
},
"original": {
@@ -261,13 +244,31 @@
"type": "indirect"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1665349835,
"narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1669542132,
"narHash": "sha256-DRlg++NJAwPh8io3ExBJdNW7Djs3plVI5jgYQ+iXAZQ=",
"lastModified": 1669969257,
"narHash": "sha256-mOS13sK3v+kfgP+1Mh56ohiG8uVhLHAo7m/q9kqAehc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a115bb9bd56831941be3776c8a94005867f316a7",
"rev": "b72b8b94cf0c012b0252a9100a636cad69696666",
"type": "github"
},
"original": {
@@ -278,20 +279,6 @@
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1669261230,
"narHash": "sha256-AjddxRPd5y5jge77281P3O8+Cnafj842Xg59rwV4x+0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8e8b5f3b1e899bf5d250279578c0283705b8cdb4",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1642635915,
"narHash": "sha256-vabPA32j81xBO5m3+qXndWp5aqepe+vu96Wkd9UnngM=",
@@ -306,7 +293,7 @@
"type": "indirect"
}
},
"nixpkgs_5": {
"nixpkgs_4": {
"locked": {
"lastModified": 1646811357,
"narHash": "sha256-JJdz8QJ8Gz9ZChGfl4P9Cm8C9mYJLRGVsXcY9gNPtuI=",
@@ -321,7 +308,7 @@
"type": "github"
}
},
"nixpkgs_6": {
"nixpkgs_5": {
"locked": {
"lastModified": 1663491030,
"narHash": "sha256-MVsfBhE9US5DvLtBAaTRjwYdv1tLO8xjahM8qLXTgTo=",
@@ -337,13 +324,29 @@
"type": "github"
}
},
"nixpkgs_7": {
"nixpkgs_6": {
"locked": {
"lastModified": 1669900182,
"narHash": "sha256-EKxjHxRJnP1w+2nnm8pq4Uqkqa5McnfPXcO8cG8Mxzc=",
"lastModified": 1670235252,
"narHash": "sha256-5YWCit/Brz4EDT/TIwXT/5wxRxb+cz1Nls7ZodQeKiw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bcb6dbbe30ce7631e5a0865dff1ab9b63d92977d",
"rev": "543070eafe8d5e86ebaa3095fd1e568db09b9b73",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1670267727,
"narHash": "sha256-hUFAn5gjNHIBpLQT0CmqpuQjQwgWUm+D6aziGAYsDmw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a5f661b80e4c163510a5013b585a040a5c7ef55e",
"type": "github"
},
"original": {
@@ -354,22 +357,6 @@
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1669809720,
"narHash": "sha256-RMT77f6CPOYtLLQ2esj+EJ1BPVWxf4RDidjrSvA5OhI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "227de2b3bbec142f912c09d5e8a1b4e778aa54fb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1665296151,
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
@@ -385,33 +372,18 @@
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1669805596,
"narHash": "sha256-g1CPQZ+1jGhY4bsjppk+gH5jfzzqmPlqGHg0zSYS3Hw=",
"owner": "nix-community",
"repo": "NUR",
"rev": "c81b1e527f3a220abfa9bf8096153d52784c5007",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"nvim": {
"nvim-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"neovim-flake": "neovim-flake",
"nixpkgs": "nixpkgs_8"
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1669882574,
"narHash": "sha256-YvfuFvOHQeQEHPoQr8sp2wnryGOucldcleWNZjvH9uY=",
"lastModified": 1670400905,
"narHash": "sha256-g7zvYhGPxqZnrueTo1NR7AU1j1ejatDO9W6GGzAfk6o=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "58c5eeb11792c32f45e1d9e06017727f722a23eb",
"rev": "36b9905aa2f520da2be8703ffcd887b7f1162f72",
"type": "github"
},
"original": {
@@ -420,52 +392,30 @@
"type": "github"
}
},
"old": {
"locked": {
"lastModified": 1669764884,
"narHash": "sha256-1qWR/5+WtqxSedrFbUbM3zPMO7Ec2CGWaxtK4z4DdvY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0244e143dc943bcf661fdaf581f01eb0f5000fcf",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"emacs": "emacs",
"emacs-overlay": "emacs-overlay",
"flake-parts": "flake-parts",
"home-manager": "home-manager",
"home-manager-stable": "home-manager-stable",
"mailserver": "mailserver",
"master": "master",
"nbfc": "nbfc",
"nix-gaming": "nix-gaming",
"nixpkgs": "nixpkgs_7",
"nur": "nur",
"nvim": "nvim",
"old": "old",
"rust": "rust",
"stable": "stable",
"stable-small": "stable-small",
"utils": "utils_4"
"nixpkgs": "nixpkgs_6",
"nvim-overlay": "nvim-overlay",
"rust-overlay": "rust-overlay"
}
},
"rust": {
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_9"
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1669862269,
"narHash": "sha256-/ar+cbAKAxd2Ng9b7EhrIMz9CP353RbmLecvyOidyUM=",
"lastModified": 1670380307,
"narHash": "sha256-7fJN5ndnE8YbrrtYdqMo3gDV/BW37M4wNBRhjdfP/XY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "bfdf688742cf984c4837dbbe1c6cbca550365613",
"rev": "fc98242f5f49d39b8fd3a611c146741a35dc012d",
"type": "github"
},
"original": {
@@ -474,38 +424,6 @@
"type": "github"
}
},
"stable": {
"locked": {
"lastModified": 1669834992,
"narHash": "sha256-YnhZGHgb4C3Q7DSGisO/stc50jFb9F/MzHeKS4giotg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "596a8e828c5dfa504f91918d0fa4152db3ab5502",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"stable-small": {
"locked": {
"lastModified": 1669861251,
"narHash": "sha256-QyBI5QNT/nQRkCsZHnN3ImKCaxrtMArVqNioA7diwU4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "af4d0d532f413ad2fbb3a13f47c98c9fca1948e1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.05-small",
"repo": "nixpkgs",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
@@ -550,21 +468,6 @@
"repo": "flake-utils",
"type": "github"
}
},
"utils_4": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",

157
flake.nix
View File

@@ -1,144 +1,43 @@
{
description = "dotfiles";
inputs = {
stable.url = github:nixos/nixpkgs/nixos-22.11;
stable-small.url = github:nixos/nixpkgs/nixos-22.05-small;
old.url = github:nixos/nixpkgs/nixos-22.05;
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
master.url = github:nixos/nixpkgs/master;
home-manager.url = github:nix-community/home-manager;
home-manager-stable.url = github:nix-community/home-manager/release-21.11;
nur.url = github:nix-community/NUR;
utils.url = github:numtide/flake-utils;
nvim.url = github:nix-community/neovim-nightly-overlay;
flake-parts.url = github:hercules-ci/flake-parts;
nvim-overlay.url = github:nix-community/neovim-nightly-overlay;
mailserver.url = gitlab:simple-nixos-mailserver/nixos-mailserver;
nbfc.url = github:nbfc-linux/nbfc-linux;
emacs.url = github:nix-community/emacs-overlay;
emacs-overlay.url = github:nix-community/emacs-overlay;
rust-overlay.url = github:oxalica/rust-overlay;
nix-gaming.url = github:fufexan/nix-gaming;
rust.url = github:oxalica/rust-overlay;
nbfc.url = github:nbfc-linux/nbfc-linux;
};
outputs = inputs@{ self, utils, nixpkgs, stable, master, old, stable-small, ... }:
with utils.lib; eachSystem
(with system;
[ x86_64-linux aarch64-linux ])
(system:
let
mkPkgs = channel: system: import channel {
inherit system;
config.allowUnfree = true;
config.allowBroken = true;
};
channels = final: prev: {
stable = mkPkgs stable prev.system;
stable-small = mkPkgs stable-small prev.system;
unstable = mkPkgs nixpkgs prev.system;
master = mkPkgs master prev.system;
old = mkPkgs old prev.system;
};
outputs = inputs@{ self, nixpkgs, ... }:
inputs.flake-parts.lib.mkFlake { inherit self; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
imports = [
./hosts
./home
./pkgs
];
perSystem = { pkgs, system, ... }: rec {
legacyPackages = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(import ./overlays/packages.nix)
inputs.nvim-overlay.overlay
inputs.emacs-overlay.overlay
inputs.rust-overlay.overlays.default
];
in
{
legacyPackages = import nixpkgs {
inherit system;
overlays = overlays ++ [
inputs.nur.overlay
inputs.nvim.overlay
inputs.rust.overlays.default
inputs.emacs.overlay
inputs.nix-gaming.overlays.default
channels
(_: _: {
nbfc-linux = inputs.nbfc.packages.${system}.nbfc-client-c;
})
];
config.allowUnfree = true;
config.allowBroken = true;
};
}) //
(
let
personalModules = [
./modules/sound.nix
];
commonModules = [
./modules/nvim
./modules/vault-agent.nix
];
serverModules = [
./modules/min-pkgs.nix
./modules/min-stuff.nix
];
homeModules = [
./home/modules/secret.nix
./home/modules/baremacs.nix
];
builders = [ ./modules/x86builder.nix ];
in
{
homeConfigurations = {
natto = inputs.home-manager.lib.homeManagerConfiguration {
modules = [
./home/natto
{
home = {
homeDirectory = "/home/natto";
username = "natto";
packages = [
inputs.home-manager.defaultPackage.x86_64-linux
];
stateVersion = "22.05";
};
}
] ++ homeModules;
pkgs = self.legacyPackages.x86_64-linux;
};
};
nixosConfigurations = {
#Home laptop
satori = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
./hosts/satori
{
nixpkgs.pkgs = self.legacyPackages.${system};
}
]
++ personalModules
++ commonModules;
};
formatter = pkgs.nixpkgs-fmt;
#Home server (RPi4)
marisa = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
modules = [
./hosts/marisa
#inputs.mailserver.nixosModules.mailserver
{
nixpkgs.pkgs = self.legacyPackages.${system};
}
]
++ commonModules
++ serverModules;
};
#Oracle Cloud VM
remilia = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
./hosts/remilia
inputs.mailserver.nixosModules.mailserver
{
nixpkgs.pkgs = self.legacyPackages.${system};
}
]
++ commonModules
++ serverModules
++ builders;
};
devShells.default = pkgs.mkShell {
packages = [ formatter ];
};
}
);
};
};
}

16
home/default.nix Normal file
View File

@@ -0,0 +1,16 @@
{ self, inputs, ... }:
{
flake.homeConfigurations = {
natto = inputs.home-manager.lib.homeManagerConfiguration {
modules = [
./natto
./modules/secret.nix
];
pkgs = self.legacyPackages.x86_64-linux;
extraSpecialArgs = {
inherit inputs;
flake = self;
};
};
};
}

View File

@@ -1,166 +0,0 @@
#modified version of home-manager emacs service module for personal use
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.baremacs;
emacsCfg = config.programs.emacs;
emacsBinPath = "${cfg.package}/bin";
# Match the default socket path for the Emacs version so emacsclient continues
# to work without wrapping it.
socketDir = "%t/emacs";
socketPath = "${socketDir}/server";
in
{
options.services.baremacs = {
enable = mkEnableOption "the Emacs daemon";
package = mkOption {
type = types.package;
default = pkgs.emacs;
defaultText = literalExpression ''
pkgs.emacs
'';
description = "The Emacs package to use.";
};
socketActivation = {
enable = mkEnableOption "systemd socket activation for the Emacs service";
};
defaultEditor = {
enable = mkOption rec {
type = types.bool;
default = false;
example = !default;
description = "Whether to change the EDITOR environment variable or not";
};
editor = mkOption rec {
type = types.enum [ "emacs" "emacsclient" ];
default = null;
example = "emacsclient";
description = "Whether to change the EDITOR environment variable or not";
};
};
copyConfigFiles = {
enable = mkOption rec {
type = types.bool;
default = false;
example = !default;
description = "Whether to copy the config files to ~/.emacs.d or not";
};
files = mkOption rec {
type = types.attrsOf types.path;
default = { };
example = { "init.el" = ./init.el; };
description = "What files to copy under what name";
};
};
};
config = mkIf cfg.enable (mkMerge [
{
assertions = [
(lib.hm.assertions.assertPlatform "services.emacs" pkgs
lib.platforms.linux)
{
assertion = cfg.defaultEditor.enable -> cfg.defaultEditor.editor != null;
message = ''
services.baremacs.defaultEditor.enable requires services.baremacs.defaultEditor.editor to be set
'';
}
];
systemd.user.services.emacs = {
Unit = {
Description = "Emacs text editor";
Documentation =
"info:emacs man:emacs(1) https://gnu.org/software/emacs/";
# Avoid killing the Emacs session, which may be full of
# unsaved buffers.
X-RestartIfChanged = false;
} // optionalAttrs (cfg.socketActivation.enable) {
# Emacs deletes its socket when shutting down, which systemd doesn't
# handle, resulting in a server without a socket.
# See https://github.com/nix-community/home-manager/issues/2018
RefuseManualStart = true;
};
Service = {
Type = "notify";
# We wrap ExecStart in a login shell so Emacs starts with the user's
# environment, most importantly $PATH and $NIX_PROFILES. It may be
# worth investigating a more targeted approach for user services to
# iport the user environment.
ExecStart = ''
${pkgs.runtimeShell} -l -c "${emacsBinPath}/emacs --fg-daemon${
# In case the user sets 'server-directory' or 'server-name' in
# their Emacs config, we want to specify the socket path explicitly
# so launching 'emacs.service' manually doesn't break emacsclient
# when using socket activation.
optionalString cfg.socketActivation.enable
"=${escapeShellArg socketPath}"
}"'';
# Emacs will exit with status 15 after having received SIGTERM, which
# is the default "KillSignal" value systemd uses to stop services.
SuccessExitStatus = 15;
Restart = "on-failure";
} // optionalAttrs (cfg.socketActivation.enable) {
# Use read-only directory permissions to prevent emacs from
# deleting systemd's socket file before exiting.
ExecStartPost =
"${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}";
ExecStopPost =
"${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}";
};
} // optionalAttrs (!cfg.socketActivation.enable) {
Install = { WantedBy = [ "default.target" ]; };
};
home = {
sessionVariables = mkIf cfg.defaultEditor.enable {
EDITOR = let editor = cfg.defaultEditor.editor; in
getBin (pkgs.writeShellScript "editor" ''
exec ${
getBin cfg.package
}/bin/'' + editor + head (optional (editor == "emacsclient") '' "''${@:---create-frame}"''));
};
packages = [ cfg.package ];
file = mkIf cfg.copyConfigFiles.enable
(mapAttrs'
(n: v:
attrsets.nameValuePair (".emacs.d/" + n) { source = v; })
cfg.copyConfigFiles.files);
};
}
(mkIf cfg.socketActivation.enable {
systemd.user.sockets.emacs = {
Unit = {
Description = "Emacs text editor";
Documentation =
"info:emacs man:emacs(1) https://gnu.org/software/emacs/";
};
Socket = {
ListenStream = socketPath;
FileDescriptorName = "server";
SocketMode = "0600";
DirectoryMode = "0700";
};
Install = { WantedBy = [ "sockets.target" ]; };
};
})
]);
}

0
home/natto/config/bspwm/bspwmrc Executable file → Normal file
View File

0
home/natto/config/dwm/autostart.sh Executable file → Normal file
View File

0
home/natto/config/dwm/bruhstatus.sh Executable file → Normal file
View File

View File

@@ -29,8 +29,8 @@ idk random variables to match my color theme
* Settings
** Setting the default face
#+begin_src emacs-lisp
(set-frame-font "Monoid 12" nil t)
(add-to-list 'default-frame-alist '(font . "Monoid-12"))
(set-frame-font "Fira Code 12" nil t)
(add-to-list 'default-frame-alist '(font . "Fira Code-12"))
#+end_src
** Some mode settings based on personal preferences
@@ -394,10 +394,22 @@ For autocomplete
#+end_src
* Random eye candy stuff
** Ligature
#+begin_src emacs-lisp
(use-package pretty-mode
(use-package ligature
:config
(global-pretty-mode t))
(ligature-set-ligatures 't '("www"))
(ligature-set-ligatures 'prog-mode '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\" "{-" "::"
":::" ":=" "!!" "!=" "!==" "-}" "----" "-->" "->" "->>"
"-<" "-<<" "-~" "#{" "#[" "##" "###" "####" "#(" "#?" "#_"
"#_(" ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" "/**"
"/=" "/==" "/>" "//" "///" "&&" "||" "||=" "|=" "|>" "^=" "$>"
"++" "+++" "+>" "=:=" "==" "===" "==>" "=>" "=>>" "<="
"=<<" "=/=" ">-" ">=" ">=>" ">>" ">>-" ">>=" ">>>" "<*"
"<*>" "<|" "<|>" "<$" "<$>" "<!--" "<-" "<--" "<->" "<+"
"<+>" "<=" "<==" "<=>" "<=<" "<>" "<<" "<<-" "<<=" "<<<"
"<~" "<~~" "</" "</>" "~@" "~-" "~>" "~~" "~~>" "%%"))
(global-ligature-mode t))
#+end_src
* Custom mode line

0
home/natto/config/xmonad/padding-icon.sh Executable file → Normal file
View File

View File

@@ -1,5 +1,11 @@
{ config, pkgs, lib, ... }:
{
home = {
homeDirectory = "/home/natto";
username = "natto";
stateVersion = "22.11";
};
imports = [
./email.nix
./secrets

0
home/natto/patches/dmenu.patch Executable file → Normal file
View File

0
home/natto/patches/dwm.patch Executable file → Normal file
View File

View File

@@ -1,11 +1,12 @@
{ config, pkgs, ... }:
{ config, flake, inputs, pkgs, ... }:
{
home.packages = with pkgs; [
# A/V, codec and media stuff
ffmpeg-full
sox
pamixer mpdas
pamixer
mpdas
mpv
mpc_cli
pulseaudio
@@ -19,8 +20,8 @@
rage
curl
(dmenu.override { patches = [ ./patches/dmenu.patch ]; })
(st.override {
patches = [ ./patches/st.patch ];
(st.override {
patches = [ ./patches/st.patch ];
extraLibs = [ harfbuzz ];
})
yt-dlp
@@ -35,8 +36,8 @@
jmtpfs
neofetch
xdotool
nbfc-linux
customscripts
(inputs.nbfc.packages.${pkgs.system}.nbfc-client-c)
(flake.packages.${pkgs.system}.customscripts)
# GUI utils
(xfce.thunar.override {
@@ -49,7 +50,7 @@
xfce.xfconf
xfce.tumbler
flameshot
(master.discord.override {
(discord.override {
nss = nss_latest;
})
qbittorrent
@@ -68,11 +69,12 @@
# Wine and games and stuff
wineWowPackages.stable
master.winetricks
tlauncher
winetricks
citra
yuzu
ryujinx
(inputs.nix-gaming.packages.${pkgs.system}.osu-stable)
(flake.packages.${pkgs.system}.tlauncher)
# Dev shit
rust-analyzer
@@ -98,7 +100,6 @@
inform7
# Misc
teams
anki-bin
tor-browser-bundle-bin
mailcap

View File

@@ -1,9 +1,9 @@
{ pkgs, config, ... }:
{
programs = {
home-manager.enable = true;
firefox = {
enable = true;
package = pkgs.master.firefox;
profiles.natto = {
name = "natto";
};

View File

@@ -1,26 +1,35 @@
{ config, pkgs, ... }:
let
home = config.home.homeDirectory;
in
{ config, pkgs, inputs, ... }:
{
services = {
baremacs = {
enable = true;
package = pkgs.mymacs.override {
config = ./config/emacs/config.org;
};
defaultEditor = {
enable = false;
editor = "emacsclient";
};
copyConfigFiles = {
enable = true;
files = {
"config.org" = ./config/emacs/config.org;
"init.el" = ./config/emacs/init.el;
};
};
home.file = with config; {
"config.org" = {
source = ./config/emacs/config.org;
target = "${home.homeDirectory}/.emacs.d/config.org";
};
"init.el" = {
source = ./config/emacs/init.el;
target = "${home.homeDirectory}/.emacs.d/init.el";
};
};
services = {
emacs =
let
mymacs = config: # with inputs.emacs-overlay.packages.${pkgs.system}; already resolved with overlay
with pkgs; emacsWithPackagesFromUsePackage {
inherit config;
package = emacsGit;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages = epkgs: with epkgs; [
use-package
(epkgs.tree-sitter-langs.withPlugins (_: epkgs.tree-sitter-langs.plugins))
];
};
in
{
enable = true;
package = mymacs ./config/emacs/config.org;
};
sxhkd = {
enable = false;
@@ -80,7 +89,7 @@ in
background = "#dc322f";
foreground = "#eee8d5";
timeout = 0;
};
};
};
};

View File

@@ -1,7 +1,7 @@
{ pkgs, config, ... }:
{ pkgs, config, flake, ... }:
{
home.pointerCursor = {
package = pkgs.simp1e-cursors;
package = flake.packages.${pkgs.system}.simp1e-cursors;
name = "Simp1e-Solarized-Light";
x11 = {
enable = true;

56
hosts/default.nix Normal file
View File

@@ -0,0 +1,56 @@
{ self, inputs, ... }:
let
inherit (inputs) nixpkgs;
specialArgs = { inherit inputs; };
commonModules = [ ./modules/nvim ];
personalModules = [ ./modules/sound.nix ];
serverModules = [
./modules/minpkgs.nix
./modules/minzsh.nix
];
builders = [
./modules/x86builder.nix
];
in
{
flake.nixosConfigurations = {
#Home laptop
satori = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
inherit specialArgs;
modules = [
./satori
{ nixpkgs.pkgs = self.legacyPackages.${system}; }
]
++ personalModules
++ commonModules;
};
#Home server (RPi4)
marisa = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
inherit specialArgs;
modules = [
./marisa
{ nixpkgs.pkgs = self.legacyPackages.${system}; }
]
++ commonModules
++ serverModules;
};
#Oracle Cloud VM
remilia = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
inherit specialArgs;
modules = [
./remilia
inputs.mailserver.nixosModules.mailserver
{ nixpkgs.pkgs = self.legacyPackages.${system}; }
]
++ commonModules
++ serverModules
++ builders;
};
};
}

0
hosts/marisa/boot.nix Executable file → Normal file
View File

1
hosts/marisa/default.nix Executable file → Normal file
View File

@@ -6,6 +6,7 @@
./hardware.nix
./boot.nix
./services.nix
./stuff.nix
];
system.stateVersion = "21.05";
}

0
hosts/marisa/hardware.nix Executable file → Normal file
View File

0
hosts/marisa/networking.nix Executable file → Normal file
View File

2
hosts/marisa/services.nix Executable file → Normal file
View File

@@ -34,7 +34,7 @@
consul = {
enable = true;
package = pkgs.master.consul;
package = pkgs.consul;
extraConfigFiles = lib.singleton "/run/consul/consul.json";
};
};

32
hosts/marisa/stuff.nix Normal file
View File

@@ -0,0 +1,32 @@
{ config, pkgs, ... }:
{
time.timeZone = "Asia/Kolkata";
security = {
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
users = [ ];
keepEnv = true;
persist = true;
}
];
};
};
programs = {
gnupg = {
agent = {
enable = true;
pinentryFlavor = "curses";
};
};
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
settings.trusted-users = [ "root" ];
};
}

16
hosts/modules/minpkgs.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
git
htop
vim
wireguard-tools
vault
tree-sitter
rnix-lsp
nmap
gcc
fly
postgresql #for the client cli
];
}

23
modules/min-pkgs.nix → hosts/modules/minzsh.nix Executable file → Normal file
View File

@@ -1,19 +1,5 @@
{ lib, config, pkgs, ... }:
{ config, ... }:
{
environment.systemPackages = with pkgs; [
git
htop
vim
wireguard-tools
vault
tree-sitter
rnix-lsp
nmap
gcc
fly
postgresql #for the client cli
];
programs = {
zsh = {
enable = true;
@@ -34,11 +20,4 @@
};
};
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
settings.trusted-users = [ "root" ];
};
}

View File

@@ -1,9 +1,10 @@
{ config, pkgs, ... }:
{inputs, config, pkgs, ... }:
{
programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
# package = inputs.nvim-overlay.packages.${pkgs.system}.default;
# package = pkgs.neovim-nightly.overrideAttrs (_:{
# nativeBuildInputs = with pkgs; [ unzip cmake pkgconfig gettext tree-sitter ];
# });
@@ -14,7 +15,7 @@
${builtins.readFile ./init.lua}
EOF
'';
packages.myVimPackage = with pkgs.unstable.vimPlugins; {
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
nvim-colorizer-lua
bracey-vim
@@ -37,7 +38,7 @@
presence-nvim
nvim-web-devicons
nvim-tree-lua
(nvim-treesitter.withPlugins (plugins: pkgs.unstable.tree-sitter.allGrammars))
(nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars))
vim-latex-live-preview
lspkind-nvim
base16-vim

View File

@@ -88,7 +88,7 @@ function _G.CompileRun()
['c'] = 'gcc ' .. file .. ' -o ' .. noext .. ' -Wno-unused-result ' .. ' && ' .. noext .. ' && rm ' .. noext,
['rust'] = 'rustc ' .. file .. ' -o ' .. noext .. ' && ' .. noext .. ' && rm ' .. noext,
['cpp'] = 'g++ -std=c++17 ' .. file .. ' -o ' .. noext .. ' -Wno-unused-result ' .. ' && ' .. noext .. ' && rm ' .. noext,
['haskell'] = 'ghc -dynamic ' .. file .. ' && ' .. noext .. ' && rm ' .. noext .. ' ' .. noext .. '.o ' .. noext .. '.hi',
['haskell'] = 'runhaskell ' .. file,
['sh'] = 'sh ' .. file,
['javascript']= 'node ' .. file,
['typescript']= 'tsc ' .. file .. ' && node ' .. noext .. '.js && rm ' .. noext .. '.js'

0
hosts/remilia/boot.nix Executable file → Normal file
View File

1
hosts/remilia/default.nix Executable file → Normal file
View File

@@ -7,6 +7,7 @@
./boot.nix
./services.nix
./mailserver.nix
./stuff.nix
];
system.stateVersion = "21.11";

0
hosts/remilia/networking.nix Executable file → Normal file
View File

0
hosts/remilia/services.nix Executable file → Normal file
View File

32
hosts/remilia/stuff.nix Normal file
View File

@@ -0,0 +1,32 @@
{ config, pkgs, ... }:
{
time.timeZone = "Asia/Kolkata";
security = {
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
users = [ ];
keepEnv = true;
persist = true;
}
];
};
};
programs = {
gnupg = {
agent = {
enable = true;
pinentryFlavor = "curses";
};
};
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
settings.trusted-users = [ "root" ];
};
}

View File

@@ -3,8 +3,7 @@
{
boot = {
supportedFilesystems = [ "zfs" ];
kernelPackages = pkgs.unstable.linuxPackages_latest;
kernelPackages = pkgs.linuxPackages_latest;
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "vfio-pci" ];
/* preDeviceCommands = ''

View File

@@ -16,8 +16,8 @@ in
opengl = {
driSupport32Bit = true;
enable = true;
package = pkgs.master.mesa.drivers;
package32 = pkgs.master.pkgsi686Linux.mesa.drivers;
package = pkgs.mesa.drivers;
package32 = pkgs.pkgsi686Linux.mesa.drivers;
};
nvidia = {
package = config.boot.kernelPackages.nvidia_x11;

View File

@@ -6,6 +6,7 @@
experimental-features = nix-command flakes
'';
settings = {
auto-optimise-store = true;
trusted-users = [ "root" "natto" ];
substituters = [
"https://nix-gaming.cachix.org"

View File

@@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, inputs, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
@@ -18,11 +18,10 @@
cachix
gcc
glibc.static
stable.openjdk
openjdk
virtmanager
tree-sitter
docker-compose
nodePackages.typescript
rust-bin.nightly.latest.default
clang-tools
rnix-lsp
@@ -44,7 +43,7 @@
};
git = {
enable = true;
package = pkgs.master.git.override {
package = pkgs.git.override {
doInstallCheck = false;
sendEmailSupport = true;
withManual = false;

View File

@@ -38,15 +38,15 @@
};
fonts.fonts = with pkgs; [
fira-mono
fira-code
lohit-fonts.devanagari
lohit-fonts.gurmukhi
nerdfonts
font-awesome
monoid
office-code-pro
hanazono
eb-garamond
# noto-fonts-cjk
noto-fonts-cjk
];
users.users.natto = {
isNormalUser = true;

View File

@@ -1,26 +0,0 @@
{config, pkgs, ...}:
{
time.timeZone = "Asia/Kolkata";
environment = {
sessionVariables = {
EDITOR = "vim";
};
};
security = {
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
users = [ ];
keepEnv = true;
persist = true;
}
];
};
};
documentation.enable = false;
users.extraUsers.root = {
shell = pkgs.zsh;
};
}

View File

@@ -1,22 +0,0 @@
{ emacsWithPackagesFromUsePackage
, stdenv
, fetchzip
, fetchurl
, fetchFromGitHub
, emacsNativeComp
, config ? null
, package ? emacsNativeComp
, ...
}:
assert (config != null);
emacsWithPackagesFromUsePackage {
inherit config package;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages = epkgs: with epkgs; [
use-package
(epkgs.tree-sitter-langs.withPlugins (_: epkgs.tree-sitter-langs.plugins))
];
}

14
pkgs/default.nix Normal file
View File

@@ -0,0 +1,14 @@
{ self, ... }: {
systems = [ "x86_64-linux" ];
flake = {
overlays = rec {
packages = import ./packages.nix;
default = packages;
};
};
perSystem = { pkgs, ... }: {
packages = self.overlays.default null pkgs;
};
}

View File

@@ -3,7 +3,6 @@ let
call = prev.callPackage; in
{
customscripts = call ./customscripts { };
mymacs = call ./emacs { };
tlauncher = call ./tlauncher { };
simp1e-cursors = call ./simp1e { };
}