Include initial basic nixos configs
This commit is contained in:
parent
2b96a873e0
commit
d486ea092e
7 changed files with 126 additions and 0 deletions
12
flake.nix
Normal file
12
flake.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
outputs = { self, nixpkgs, ... }@attrs: {
|
||||
nixosConfigurations = {
|
||||
nixos = import ./nixos attrs;
|
||||
};
|
||||
};
|
||||
}
|
28
nixos/configuration.nix
Normal file
28
nixos/configuration.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# Basic system settings
|
||||
networking.hostName = "localhost";
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
# User configuration
|
||||
users.users.compey = {
|
||||
isNormalUser = true;
|
||||
home = "/home/compey";
|
||||
extraGroups = [ "wheel" ];
|
||||
password = "$6$qVioWfelj.mvmSeM$x.scXIyRhimd.Kp2.Yzzqq8gGctYsT1Tfz4Gf14pb3Kgtbjh59PIF62uahzgUP.SdzUkLPm/arMSilpcdsC561";
|
||||
shell = pkgs.fish;
|
||||
};
|
||||
|
||||
# Create root user
|
||||
users.users.root.initialHashedPassword = "";
|
||||
|
||||
# Enable sudo support
|
||||
security.sudo.enable = true;
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
# Enable OpenSSH server (optional)
|
||||
services.openssh.enable = true;
|
||||
services.openssh.permitRootLogin = "prohibit-password";
|
||||
}
|
||||
|
16
nixos/default.nix
Normal file
16
nixos/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ nixpkgs, ... }@inputs:
|
||||
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
|
||||
modules = [
|
||||
./nix.nix
|
||||
./configuration.nix
|
||||
./programs/xdg.nix
|
||||
./programs/neovim.nix
|
||||
./programs/shell.nix
|
||||
];
|
||||
}
|
5
nixos/nix.nix
Normal file
5
nixos/nix.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
}
|
12
nixos/programs/neovim.nix
Normal file
12
nixos/programs/neovim.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."nvim" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.dotfiles/.config/nvim";
|
||||
};
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
}
|
42
nixos/programs/shell.nix
Normal file
42
nixos/programs/shell.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.bash.enable = true;
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
{
|
||||
name = "fisher";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jorgebucaran";
|
||||
repo = "fisher";
|
||||
rev = "4.4.5";
|
||||
sha256 = "0y87w6gdr56808fjc3xpidqrc27cj7cr0kp9d5ca6v3y05a3bgdd";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
home.file.".bashrc".source = lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.dotfiles/.bashrc"
|
||||
home.file.".bash_profile".source = lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.dotfiles/.bash_profile"
|
||||
home.file.".profile".source = lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.dotfiles/.profile"
|
||||
xdg.configFile."fish" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.dotfiles/.config/fish";
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
pkgs.lsd
|
||||
pkgs.bat
|
||||
pkgs.zoxide
|
||||
(pkgs.stdenv.mkDerivation {
|
||||
pname = "catppuccin-fish";
|
||||
version = "1.0.0";
|
||||
buildInputs = [ pkgs.fish ];
|
||||
installPhase = ''
|
||||
fisher install catppuccin/fish
|
||||
fish_config theme save "Catppuccin Mocha"
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
|
11
nixos/programs/xdg.nix
Normal file
11
nixos/programs/xdg.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue