Skip to content

Commit

Permalink
add emacs base
Browse files Browse the repository at this point in the history
  • Loading branch information
luqmanishere committed May 3, 2024
1 parent b5b3b19 commit 7ed852e
Show file tree
Hide file tree
Showing 19 changed files with 296 additions and 97 deletions.
250 changes: 168 additions & 82 deletions flake.lock

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@
];

flake = {
#main laptop
nixosConfigurations.asuna = self.nixos-flake.lib.mkLinuxSystem ./systems/asuna;
nixosConfigurations = {
#main laptop
asuna = self.nixos-flake.lib.mkLinuxSystem ./systems/asuna;

# configuration for WSL
nixosConfigurations.sinon = self.nixos-flake.lib.mkLinuxSystem ./systems/sinon.nix;
# configuration for WSL
sinon = self.nixos-flake.lib.mkLinuxSystem ./systems/sinon.nix;

# configuration for rpi4 (for building on aarch64 systems);
fenrys = self.nixos-flake.lib.mkLinuxSystem ./systems/fenrys.nix;

fenrys-cross =
nixpkgs.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.nixos ./systems/fenrys.nix;
};
};

_module.args._inputs = inputs // {inherit self;};
Expand All @@ -60,6 +68,7 @@
# do not set overlays for the flake here unless absolutely necessary.
# set them in nixos modules whenever possible
# inputs.neovim-nightly-overlay.overlay
inputs.emacs-overlay.overlays.default
];
};

Expand Down Expand Up @@ -146,6 +155,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};

emacs-overlay.url = "github:nix-community/emacs-overlay";

devenv.url = "github:cachix/devenv";
# to remove warnings on nix flake check
nix2container.url = "github:nlewo/nix2container";
Expand Down
7 changes: 7 additions & 0 deletions home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
./browsers/firefox.nix
./prod/essentials.nix
./terminals/wezterm
./editors/neovide.nix
];

wayland.imports = [
Expand All @@ -49,6 +50,8 @@
self.homeModules.gui
self.homeModules.wayland
self.homeModules.misc-gui

./editors/emacs
];
};

Expand All @@ -61,6 +64,10 @@
./terminals/kitty.nix
];
};

luqman-fenrys = {
imports = [self.homeModules.common ./luqman-home.nix];
};
};
};
}
3 changes: 2 additions & 1 deletion home/editors/astronvim/config/lua/community.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ return {
variables = {},
-- Background styles. Can be "dark", "transparent" or "normal"
sidebars = "dark", -- style for sidebars, see below
floats = "dark", -- style for floating windows
floats = "dark", -- style for floating windows
},
},
},
Expand All @@ -37,6 +37,7 @@ return {
{ import = "astrocommunity.pack.sql" },
{ import = "astrocommunity.pack.tailwindcss" },
{ import = "astrocommunity.pack.yaml" },
{ import = "astrocommunity.pack.vue" },

{ import = "astrocommunity.color.ccc-nvim" },
{ import = "astrocommunity.color.mini-hipatterns" },
Expand Down
3 changes: 0 additions & 3 deletions home/editors/astronvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ in {
statix
deadnix
selene

#gui
neovide
];

programs.neovim = {
Expand Down
11 changes: 11 additions & 0 deletions home/editors/emacs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{pkgs, ...}: {
config = {
programs.emacs = {
enable = true;
package = pkgs.emacs-pgtk;
};

services.emacs.enable = true;
services.emacs.package = pkgs.emacs-pgtk;
};
}
1 change: 1 addition & 0 deletions home/editors/neovide.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{pkgs, ...}: {config = {home.packages = with pkgs; [neovide];};}
2 changes: 1 addition & 1 deletion home/games/general.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
gamescope
mangohud
scrcpy
discord
(discord.override {withVencord = true;})
];
};
}
4 changes: 2 additions & 2 deletions home/tools/mpd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in {
};
};

config = mkIf (cfg.enable) {
config = mkIf cfg.enable {
home.packages = with pkgs; [
mpc-cli
playerctl
Expand Down Expand Up @@ -81,7 +81,7 @@ in {
};

# show current playing in discord
services.mpd-discord-rpc.enable = true;
services.mpd-discord-rpc.enable = false;
services.mpd-discord-rpc.settings = {
id = 1084861522888642661;
format = {
Expand Down
6 changes: 5 additions & 1 deletion home/wayland-shell/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ in {
"opaque, title:(Picture-in-Picture)"
"float, title:(muzik)"
"opaque, title:(muzik)"
"float, class:(ayaya-project-manager)"
"opaque, class:(ayaya-project-manager)"

"animation slide, class:(pavucontrol)"
];

# TODO: segregate these into logical sections
Expand Down Expand Up @@ -210,7 +214,7 @@ in {
"SUPERSHIFT, B, exec, killall -SIGUSR2 waybar" # waybar reload
"SUPERSHIFT, N, exec, killall -SIGUSR1 waybar" # waybar hide

"SUPERSHIFT, L, exec, loginctl lock-session"
"SUPERSHIFT, L, exec, loginctl lock-session && sleep 5 && hyprctl dispatch dpms off"
"SUPERSHIFT, S, exec, ${lib.getExe pkgs.grim} -g ${lib.getExe pkgs.slurp} "

# FIXME: WTH IS THIS?
Expand Down
6 changes: 6 additions & 0 deletions nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ in {
hostname = "sinon";
nixosModules = [./wsl.nix];
};

# rpi4 config
fenrys = mkSystem {
hostname = "fenrys";
nixosModules = [];
};
};
};
}
2 changes: 1 addition & 1 deletion nixos/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ in {
};

# put nixos overlays here
overlays = [inputs.neovim-nightly-overlay.overlays.default];
overlays = [inputs.neovim-nightly-overlay.overlays.default inputs.emacs-overlay.overlays.default];
};

nix = {
Expand Down
4 changes: 2 additions & 2 deletions nixvim/mappings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ _: {
}
{
action = "<cmd>NvimTreeToggle<CR>";
key = "<leader>o";
key = "<leader>e";
mode = "n";
options.desc = "Open (or close) nvim-tree";
}
{
action = "<cmd>NvimTreeFocus<CR>";
key = "<leader>e";
key = "<leader>o";
mode = "n";
options.desc = "Move focus to NvimTree";
}
Expand Down
1 change: 1 addition & 0 deletions nixvim/ui.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs, ...}: {
imports = [./windline.nix];
config = {
colorschemes.kanagawa = {enable = true;};
plugins = {
Expand Down
19 changes: 19 additions & 0 deletions nixvim/windline.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{pkgs, ...}: {
config = {
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin
{
name = "windline";
src = pkgs.fetchFromGitHub {
owner = "windwp";
repo = "windline.nvim";
rev = "54401a62c61d56fe9df106321b158c9048aa5f9b";
hash = "sha256-95hsm+1dKKnW9jW8yAaF7r/ESB12qugGXzJ/IjbrOxU=";
};
})
];
extraConfigLua = ''
require('wlsample.wind')
'';
};
}
1 change: 1 addition & 0 deletions result
5 changes: 5 additions & 0 deletions systems/asuna/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ in {

# Enable the OpenSSH daemon.
openssh.enable = true;
resolved = {
enable = true;
fallbackDns = ["1.1.1.1" "8.8.8.8"];
};
};
networking.networkmanager.connectionConfig = {"connection.mdns" = 2;};

programs = {
dconf.enable = true;
Expand Down
3 changes: 3 additions & 0 deletions systems/asuna/hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
];

boot = {
# build stuff for rpi
binfmt.emulatedSystems = ["aarch64-linux"];

loader = {
systemd-boot.enable = true;
systemd-boot.configurationLimit = 10;
Expand Down
46 changes: 46 additions & 0 deletions systems/fenrys.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
flake,
lib,
...
}: let
inherit (flake) inputs;
inherit (inputs) nixpkgs self;
in {
imports = [
self.nixosModules.fenrys
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
];

time.timeZone = "Asia/Kuala_Lumpur";
i18n.defaultLocale = "en_US.UTF8";
sdImage.compressImage = false;

networking.wireless.networks = {
"Sapi" = {pskRaw = "261aa691d2135810dcff3b7b8248f63727c8088b4d9f7618f3685a61ce03b341";};
};

networking.hostName = "fenrys";

users.users.luqman.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDW+oXpKYSILzxc4O5Nrlf1oObQQc4XrawHWQmd5yvspQI6G5138KhX4woq65P1dGRguLvj3wWwJt5zKf533995radcusma9G1YDMWgkq+bKz+eNvY4n3zkA3EeKAlLsdwf/bA1ydLqK/LOTmBjTQqoxJsiQ7sqWCQFKZxRPlaRKsEnL8PmhkQNll8sJJ0GY559kODKArAjqYxNVPnOjijfl80WjIplrxKOdlaK79zJxv955lQTRNotI/wITnbOSpi2IMrbhCXQ5IViVj1fr5CwxPO1hrz5wRaycUhErtxzQS+Cvfkp5ooaOJSNRtmxoGC0hPxO8Vi+SrL28mH8ziPn"
];

services.openssh.enable = true;

nixpkgs.hostPlatform = lib.mkForce "aarch64-linux";

services.avahi = {
enable = true;
nssmdns4 = true;
publish = {
enable = true;
addresses = true;
domain = true;
hinfo = true;
userServices = true;
workstation = true;
};
};

system.stateVersion = "22.11"; # Did you read the comment?
}

0 comments on commit 7ed852e

Please sign in to comment.