Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begins NixOS for a desktop option
Browse files Browse the repository at this point in the history
kachick committed Apr 28, 2024
1 parent 76a7f37 commit dc88561
Showing 4 changed files with 277 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ tmp/

.direnv

*hardware-configuration.nix

# macOS
**/AppSupport
.DS_Store
201 changes: 201 additions & 0 deletions nixos/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
# 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
];

nix.settings.experimental-features = [
"nix-command"
"flakes"
];

# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

# 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/Tokyo";

# Select internationalisation properties.
i18n.defaultLocale = "ja_JP.UTF-8";

i18n.extraLocaleSettings = {
LC_ADDRESS = "ja_JP.UTF-8";
LC_IDENTIFICATION = "ja_JP.UTF-8";
LC_MEASUREMENT = "ja_JP.UTF-8";
LC_MONETARY = "ja_JP.UTF-8";
LC_NAME = "ja_JP.UTF-8";
LC_NUMERIC = "ja_JP.UTF-8";
LC_PAPER = "ja_JP.UTF-8";
LC_TELEPHONE = "ja_JP.UTF-8";
LC_TIME = "ja_JP.UTF-8";
};

# Enable the X11 windowing system.
services.xserver.enable = true;

# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;

# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};

# Enable CUPS to print documents.
services.printing.enable = true;

# Didn't work for current device
# services.fprintd = {
# enable = true;

# # https://gitlab.freedesktop.org/libfprint/libfprint/-/issues/402#note_1860665

# # https://discourse.nixos.org/t/cannot-enroll-fingerprints-with-fprintd-no-devices-available/40362
# tod = {
# enable = true;
# driver = pkgs.libfprint-2-tod1-elan;
# };

# # https://github.com/NixOS/nixpkgs/issues/298150
# package = pkgs.fprintd.overrideAttrs {
# mesonCheckFlags = [
# "--no-suite"
# "fprintd:TestPamFprintd"
# ];
# };
# };

# https://sbulav.github.io/nix/nix-fingerprint-authentication/
security.pam.services.swaylock = { };
security.pam.services.swaylock.fprintAuth = true;

# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;

# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};

# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;

# Define a user account. Don't forget to set a password with ‘passwd’.
users.users = {
kachick = {
isNormalUser = true;
description = "admin";
extraGroups = [
"networkmanager"
"wheel"
];
packages = with pkgs; [ firefox ];
};
};

i18n.inputMethod = {
enabled = "fcitx5";

fcitx5.addons = [
pkgs.fcitx5-mozc
pkgs.fcitx5-gtk
];
};

services.dbus.packages = [ config.i18n.inputMethod.package ];

# Allow unfree packages
nixpkgs.config.allowUnfree = 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.
micro
alacritty
ibm-plex

wget
curl
git
bat
coreutils
findutils
fd
fzf
ripgrep

# https://github.com/NixOS/nixpkgs/issues/33282
xdg-user-dirs
vscodium
];

# https://github.com/NixOS/nixpkgs/issues/33282#issuecomment-523572259
environment.etc."xdg/user-dirs.defaults".text = ''
DESKTOP=Desktop
DOCUMENTS=Documents
DOWNLOAD=Downloads
MUSIC=Music
PICTURES=Pictures
PUBLICSHARE=Public
TEMPLATES=Templates
VIDEOS=Videos
'';

# 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?

programs.hyprland.enable = true;
}
44 changes: 44 additions & 0 deletions nixos/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions nixos/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
description = "A simple NixOS flake";

inputs = {
# NixOS official package source, using the nixos-23.11 branch here
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
# unstable-pkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs =
{
self,
nixpkgs,
# unstable-pkgs,
...
}@inputs:
{
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
# specialArgs = {
# inherit unstable-pkgs;
# };
modules = [
# Import the previous configuration.nix we used,
# so the old configuration file still takes effect
./configuration.nix
];
};
};
}

0 comments on commit dc88561

Please sign in to comment.