Fix all the bugs after the first installation

This commit is contained in:
Sameer Rahmani 2024-02-26 16:29:30 +00:00
parent 3d75273a40
commit 61ec06c4b3
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
9 changed files with 208 additions and 71 deletions

View File

@ -1,9 +1,27 @@
{
"nodes": {
"disko": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1708564520,
"narHash": "sha256-juduDTYBhGN6jNfQ5RMDpbQF+MkO0pj3k7XGDSTjAbs=",
"owner": "nix-community",
"repo": "disko",
"rev": "23d308f0059955e3719efc81a34d1fc0369fbb74",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"emacs-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
@ -25,7 +43,7 @@
"inputs": {
"emacs-overlay": "emacs-overlay",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1708611597,
@ -170,16 +188,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1707689078,
"narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
"lastModified": 1708501555,
"narHash": "sha256-zJaF0RkdIPbh8LTmnpW/E7tZYpqIE+MePzlWwUNob4c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
"rev": "b50a77c03d640716296021ad58950b1bb0345799",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
@ -202,11 +220,11 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1708210246,
"narHash": "sha256-Q8L9XwrBK53fbuuIFMbjKvoV7ixfLFKLw4yV+SD28Y8=",
"lastModified": 1708819810,
"narHash": "sha256-1KosU+ZFXf31GPeCBNxobZWMgHsSOJcrSFA6F2jhzdE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "69405156cffbdf2be50153f13cbdf9a0bea38e49",
"rev": "89a2a12e6c8c6a56c72eb3589982c8e2f89c70ea",
"type": "github"
},
"original": {
@ -217,6 +235,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1707689078,
"narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1707451808,
"narHash": "sha256-UwDBUNHNRsYKFJzyTMVMTF5qS4xeJlWoeyJf+6vvamU=",
@ -232,7 +266,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1707451808,
"narHash": "sha256-UwDBUNHNRsYKFJzyTMVMTF5qS4xeJlWoeyJf+6vvamU=",
@ -250,12 +284,13 @@
},
"root": {
"inputs": {
"disko": "disko",
"fg42": "fg42",
"flake_utils": "flake_utils",
"home-manager": "home-manager",
"nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"sops": "sops"
}
},
@ -267,11 +302,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1708500294,
"narHash": "sha256-mvJIecY3tDKZh7297mqOtOuAvP7U1rqjfLNfmfkjFpU=",
"lastModified": 1708830076,
"narHash": "sha256-Cjh2xdjxC6S6nW6Whr2dxSeh8vjodzhTmQdI4zPJ4RA=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "f6b80ab6cd25e57f297fe466ad689d8a77057c11",
"rev": "2874fbbe4a65bd2484b0ad757d27a16107f6bc17",
"type": "github"
},
"original": {

View File

@ -44,6 +44,7 @@
# To build and android image
# robotnix.url = "github:danielfullmer/robotnix";
# impermanence.url = "github:nix-community/impermanence";
disko.url = "github:nix-community/disko";
};
outputs = { self, nixpkgs, ... } @ inputs:

View File

@ -21,7 +21,6 @@ rec {
imports = [
params.nixos-generators.nixosModules.all-formats
];
nixpkgs.hostPlatform = "x86_64-linux";
# customize an existing format
@ -85,19 +84,33 @@ rec {
# Some compression/archiver tools.
pkgs.unzip
pkgs.zip
pkgs.ripgrep
pkgs.bat
pkgs.wget
pkgs.curl
pkgs.htop
pkgs.man
pkgs.man-pages
pkgs.man-pages-posix
pkgs.emacs-nox
universePkg
];
environment.variables.EDITOR = "emacs";
documentation.enable = true;
documentation.dev.enable = true;
documentation.man = {
man-db.enable = true;
enable = true;
generateCaches = true;
};
nix.settings = {
experimental-features = lib.mkDefault "nix-command flakes";
};
@ -130,24 +143,37 @@ rec {
services.xserver = {
enable = true;
autorun = false;
xkb.layout = "us";
xkb.options = "eurosign:e";
displayManager = {
startx = {
enable = true;
};
defaultSession = "fg42";
startx.enable = true;
};
# desktopManager = {
# session = lib.mkForce [{
# name = "fg42";
# start = ''
# ${pkgs.runtimeShell} $HOME/.fg42-xsession &
# waitPID=$!
# '';
# }];
# };
libinput.enable = true; # for touchpad support
videoDrivers = [
"modesetting"
"fbdev"
"amdgpu"
];
};
# environment.variables = {
# GDK_SCALE = "2";
# GDK_DPI_SCALE = "0.5";
# _JAVA_OPTIONS = "-Dsun.java2d.uiScale=2";
# };
sound.enable = true;
# Enable sound in virtualbox appliances.
hardware.pulseaudio.enable = true;
@ -156,10 +182,14 @@ rec {
enable = true;
setLdLibraryPath = true;
package = pkgs.mesa_drivers;
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = [
pkgs.glxinfo
pkgs.xorg.xhost # not included by the x11 nixos module bydefault
];
networking.networkmanager.enable = true;
@ -191,7 +221,13 @@ rec {
};
};
disk = diskFile: grubPart: { lib, pkgs, ... }: {
disk = diskFile: grubPart: { lib, pkgs, inputs, ... }: {
imports = [
"${inputs.disko}/module.nix"
];
disko = import diskFile;
environment.systemPackages = [
pkgs.disko
];
@ -200,7 +236,9 @@ rec {
"disks.nix".source = diskFile;
};
boot.loader.grub.device = grubPart;
boot.loader.grub.device = "nodev";
boot.loader.grub.efiSupport = true;
boot.loader.grub.efiInstallAsRemovable = true;
};
autoInstaller = host: partitioner: { lib, pkgs, ... }: {

View File

@ -30,13 +30,6 @@ rec {
inputs.sops.nixosModules.sops
];
sops.secrets.lxsameer-password = {
sopsFile = ./secrets.yaml;
format = "yaml";
neededForUsers = true;
key = "password";
};
users = {
users.lxsameer = {
isNormalUser = true;
@ -45,7 +38,7 @@ rec {
"wheel"
"networkmanager"
];
hashedPasswordFile = config.sops.secrets.lxsameer-password.path;
password = "123123";
};
};

View File

@ -34,21 +34,29 @@
# xxx
# '';
# This is a hack to make fg42/home-manager/startx co-operate
home.file.".xinitrc".text = ''
# xset b off
# xsetroot -solid black &
exec ${params.fg42}/bin/fg42-wm
xset b off
xsetroot -solid black &
exec $HOME/.fg42-xsession
'';
home.file.".fg42.el".source = ./fg42.el;
# set cursor size and dpi for 4k monitor
xresources.properties = {
"Xcursor.size" = 16;
"Xft.dpi" = 172;
"Xft.dpi" = 96;
"Xft.autohint" = 0;
"Xft.lcdfilter" = "lcddefault";
"Xft.hintstyle" = "hintfull";
"Xft.hinting" = 1;
"Xft.antialias" = 1;
# Xft.rgba: rgb
};
fonts.fontconfig.enable = true;
home.extraOutputsToInstall = [ "man" ];
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
params.fg42
@ -57,6 +65,10 @@
xz
unzip
# browsers
librewolf
firefox
# utils
ripgrep
eza # A modern replacement for ls
@ -80,7 +92,8 @@
gawk
zstd
gnupg
libnotify
# nix related
#
# it provides the command `nom` works just like `nix`
@ -109,13 +122,60 @@
vazir-fonts
fira-code
nerdfonts
thefuck
yubioath-flutter
];
# basic configuration of git, please change to your own
programs.git = {
enable = true;
package = pkgs.gitFull;
userName = "Sameer Rahmani";
userEmail = "lxsameer@gnu.org";
aliases = {
co = "checkout";
br = "branch";
ci = "commit";
st = "status";
unstage = "reset HEAD --";
last = "log -1 HEAD";
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
brs = "for-each-ref --sort='-authordate:iso8601' --count 20 --format=' %(color:green)%(authordate:relative)%09%(if)%(HEAD)%(then)%(color:brightwhite)*%(else)%(color:white) %(end)%(refname:short)%09%(color:yellow)%(authorname)%(authoremail)' refs/heads";
};
signing = {
key = "6F3FA93B4BD9C3CAEF3877E6384A12C310233CC5";
signByDefault = true;
};
difftastic.enable = true;
# delta.enable = true;
extraConfig = {
core = {
abbrev = 12;
excludesFile = "${./git/gitignore}";
};
pretty = {
fixes = "Fixes: %h (\"%s\")";
};
url."git@github.com:" = {
insteadOf = "https://github.com/";
};
sendemail = {
smtpEncryption = "tls";
smtpServer = "fencepost.gnu.org";
smtpUser = "lxsameer";
smtpServerPort = 587;
};
status.submoduleSummary = true;
pull.rebase = false;
http.sslVerify = true;
};
};
# starship - an customizable prompt for any shell
@ -137,7 +197,7 @@
settings = {
env.TERM = "xterm-256color";
font = {
size = 12;
size = 10;
draw_bold_text_with_bright_colors = true;
};
scrolling.multiplier = 5;
@ -160,6 +220,7 @@
g = "git";
d = "docker";
n = "nix";
ew = "emacs -nw";
_ = "sudo";
};
@ -232,7 +293,13 @@
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
};
programs.mpv.enable = true;
programs.obs-studio.enable = true;
programs.noti.enable = true;
# Let home Manager install and manage itself.
programs.home-manager.enable = true;
# This value determines the home Manager release that your
# configuration is compatible with. This helps avoid breakage
@ -244,18 +311,28 @@
# changes in each release.
home.stateVersion = "24.05";
# Let home Manager install and manage itself.
programs.home-manager.enable = true;
home.sessionVariables.XMODIFIERS = "@im=exim";
home.sessionVariables.GTK_IM_MODULE = "xim";
home.sessionVariables.QT_IM_MODULE = "xim";
home.sessionVariables.CLUTTER_IM_MODULE = "xim";
xsession.enable = true;
xsession.profileExtra = ''
export XMODIFIERS=@im=exwm-xim
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
export CLUTTER_IM_MODULE=xim
systemctl --user import-environment XMODIFIERS GTK_IM_MODULE QT_IM_MODULE CLUTTER_IM_MODULE
'';
xsession.scriptPath = ".fg42-xsession";
xsession.windowManager.command = "${params.fg42}/bin/fg42-wm";
# services.xserver = {
# enable = true;
# autorun = false;
# displayManager.startx.enable = true;
# };
services.dunst.enable = true;
services.pasystray.enable = true;
services.network-manager-applet.enable = true;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
};
}

View File

@ -29,7 +29,6 @@
(use-flags
(fg42/merge-with-default-flags
-wm
dracula-theme
-badwolf-theme
python

View File

@ -0,0 +1,3 @@
*~
.dir-locals.el
#*#

View File

@ -33,17 +33,9 @@ let
networking.hostName = "majin";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
fileSystems."/" =
if inVM
then {
device = "ata-QEMU_HARDDISK_QM00001-part2";
fsType = "ext4";
}
else {
device = "/dev/nvme1n1p3";
fsType = "ext4";
};
boot.initrd.kernelModules = [ "amdgpu" ];
hardware.enableRedistributableFirmware = true;
hardware.cpu.amd.updateMicrocode = true;
};
lxsameer = pkgs.callPackage ../users/lxsameer/default.nix {};
@ -57,7 +49,7 @@ in {
host = if inVM then "majinVM" else "majin";
diskModule = (modules.disk
(if inVM then ./majin/vm.disk.nix else ./majin/disks.nix)
(if inVM then "/dev/sda" else "/dev/nvme1n1"));
(if inVM then "/dev/sda" else "/dev/disk/by-partlabel/disk-twoT-root"));
});
majin = nixpkgs.lib.nixosSystem {
@ -68,9 +60,8 @@ in {
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
this
(disk
(if inVM then ./majin/vm.disk.nix else ./majin/disk.nix)
(if inVM then "/dev/sda" else "/dev/nvme1n1"))
(if inVM then ./majin/vm.disk.nix else ./majin/disks.nix)
(if inVM then "/dev/sda" else "/dev/disk/by-partlabel/disk-twoT-root"))
bootable
base
lxsameer.user

View File

@ -1,26 +1,26 @@
{
disko.devices = {
devices = {
disk = {
nvme0n1 = {
device = "/dev/nvme0n1";
oneT = {
device = "/dev/disk/by-id/nvme-Seagate_FireCuda_530_ZP1000GM30013_7VQ04CBH";
type = "disk";
content = {
type = "gpt";
partitions = {
nix = {
home = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/nix";
mountpoint = "/home";
};
};
};
};
};
nvme1n1 = {
device = "/dev/nvme1n1";
twoT = {
device = "/dev/disk/by-id/nvme-Samsung_SSD_990_PRO_2TB_S7DNNJ0WA07648B";
type = "disk";
content = {
type = "gpt";
@ -34,7 +34,7 @@
mountpoint = "/boot";
};
};
plainSwap = {
swap = {
size = "64G";
content = {
type = "swap";